/ <summary>
	/// An add-in.
	/// </summary>
	public class Addin
	{
		AddinInfo addin;
		string sourceFile;
		WeakReference desc;
		AddinDatabase database;
		bool? isLatestVersion;
		bool? isUserAddin;
		string id;
		string domain;
		
		internal Addin (AddinDatabase database, string domain, string id)
		{
			this.database = database;
			this.id = id;
			this.domain = domain;
			LoadAddinInfo ();
		}

		/// <summary>
		/// Full identifier of the add-in, including namespace and version.
		/// </summary>
		public string Id {
			get { return id; }
		}
		
		/// <summary>
		/// Namespace of the add-in.
		/// </summary>
		public string Namespace {
			get { return this.AddinInfo.Namespace; }
		}
		
		/// <summary>
		/// Identifier of the add-in (without namespace)
		/// </summary>
		public string LocalId {
			get { return this.AddinInfo.LocalId; }
		}
		
		/// <summary>
		/// Version of the add-in
		/// </summary>
		public string Version {
			get { return this.AddinInfo.Version; }
		}
		
		/// <summary>
		/// Display name of the add-in
		/// </summary>
		public string Name {
			get { return this.AddinInfo.Name; }
		}
		
		/// <summary>
		/// Custom properties specified in the add-in header
		/// </summary>
		public AddinPropertyCollection Properties {
			get { return this.AddinInfo.Properties; }
		}
		
		internal string PrivateDataPath {
			get { return Path.Combine (database.AddinPrivateDataPath, Path.GetFileNameWithoutExtension (Description.FileName)); }
		}
		
		/// <summary>
		/// Checks version compatibility.
		/// </summary>
		/// <param name="version">
		/// An add-in version.
		/// </param>
		/// <returns>
		/// True if the provided version is compatible with this add-in.
		/// </returns>
		/// <remarks>
		/// This method checks the CompatVersion property to know if the provided version is compatible with the version of this add-in.
		/// </remarks>
		public bool SupportsVersion (string version)
		{
			return AddinInfo.SupportsVersion (version);
		}

		/// <summary>
		/// Returns a <see cref="System.String"/> that