internal AddinRegistry (string registryPath, string startupDirectory)
		{
			basePath = Util.GetFullPath (registryPath);
			database = new AddinDatabase (this);
			addinDirs = new StringCollection ();
			addinDirs.Add (Path.Combine (basePath, "addins"));
		}
Beispiel #2
0
        public AddinScanner(AddinDatabase database, AddinScanResult scanResult, IProgressStatus monitor)
        {
            this.database = database;
            if (!scanResult.CheckOnly) {

                // If there is a local copy of the cecil reflector, use it instead of the one in the gac
                Type t;
                string asmFile = Path.Combine (Path.GetDirectoryName (GetType().Assembly.Location), "Mono.Addins.CecilReflector.dll");
                if (File.Exists (asmFile)) {
                    Assembly asm = Assembly.LoadFrom (asmFile);
                    t = asm.GetType ("Mono.Addins.CecilReflector.Reflector");
                }
                else {
                    string refName = GetType().Assembly.FullName;
                    int i = refName.IndexOf (',');
                    refName = "Mono.Addins.CecilReflector.Reflector, Mono.Addins.CecilReflector" + refName.Substring (i);
                    t = Type.GetType (refName, false);
                }
                if (t != null)
                    reflector = (IAssemblyReflector) Activator.CreateInstance (t);
                else
                    reflector = new DefaultAssemblyReflector ();

                if (monitor.LogLevel > 1)
                    monitor.Log ("Using assembly reflector: " + reflector.GetType ());
                reflector.Initialize (scanResult);
                coreAssembly = reflector.LoadAssembly (GetType().Assembly.Location);
            }
        }
Beispiel #3
0
		internal Addin (AddinDatabase database, string domain, string id)
		{
			this.database = database;
			this.id = id;
			this.domain = domain;
			LoadAddinInfo ();
		}
Beispiel #4
0
        internal AddinRegistry(AddinEngine engine, string registryPath, string startupDirectory)
        {
            basePath = Util.GetFullPath (Util.NormalizePath (registryPath));
            database = new AddinDatabase (engine, this);

            // Look for add-ins in the hosts directory and in the default
            // addins directory
            addinDirs = new StringCollection ();
            addinDirs.Add (DefaultAddinsFolder);

            // Get the domain corresponding to the startup folder
            if (startupDirectory != null && startupDirectory.Length > 0) {
                this.startupDirectory = Util.NormalizePath (startupDirectory);
                currentDomain = database.GetFolderDomain (null, this.startupDirectory);
            } else
                currentDomain = AddinDatabase.GlobalDomain;
        }
		public AddinRegistry (string registryPath, string startupDirectory)
		{
			basePath = Util.GetFullPath (registryPath);
			database = new AddinDatabase (this);

			// Look for add-ins in the hosts directory and in the default
			// addins directory
			addinDirs = new StringCollection ();
			addinDirs.Add (database.HostsPath);
			addinDirs.Add (DefaultAddinsFolder);
			
			// Get the domain corresponding to the startup folder
			if (startupDirectory != null) {
				this.startupDirectory = startupDirectory;
				currentDomain = database.GetFolderDomain (null, startupDirectory);
			} else
				currentDomain = AddinDatabase.GlobalDomain;
		}
Beispiel #6
0
 internal Addin(AddinDatabase database, string file)
 {
     this.database = database;
     configFile = file;
 }
Beispiel #7
0
 public AddinScanner(AddinDatabase database, AddinScanResult scanResult, IProgressStatus monitor)
 {
     this.database = database;
     fs = database.FileSystem;
 }
Beispiel #8
0
 public void CopyExtensions(AddinDatabase other)
 {
     foreach (object o in other.extensions)
         RegisterExtension (o);
 }
		internal Addin (AddinDatabase database, string hostId, string hostSourceFile)
		{
			this.database = database;
			this.hostId = hostId;
			this.sourceFile = hostSourceFile;
		}
		public AddinScanner (AddinDatabase database)
		{
			this.database = database;
		}
Beispiel #11
0
		internal AddinRegistry (AddinEngine engine, string registryPath, string startupDirectory, string addinsDir, string databaseDir)
		{
			basePath = Path.GetFullPath (Util.NormalizePath (registryPath));
			
			if (addinsDir != null) {
				addinsDir = Util.NormalizePath (addinsDir);
				if (Path.IsPathRooted (addinsDir))
					this.addinsDir = Path.GetFullPath (addinsDir);
				else
					this.addinsDir = Path.GetFullPath (Path.Combine (basePath, addinsDir));
			} else
				this.addinsDir = Path.Combine (basePath, "addins");
			
			if (databaseDir != null) {
				databaseDir = Util.NormalizePath (databaseDir);
				if (Path.IsPathRooted (databaseDir))
					this.databaseDir = Path.GetFullPath (databaseDir);
				else
					this.databaseDir = Path.GetFullPath (Path.Combine (basePath, databaseDir));
			}
			else
				this.databaseDir = Path.GetFullPath (basePath);

			// Look for add-ins in the hosts directory and in the default
			// addins directory
			addinDirs = new StringCollection ();
			addinDirs.Add (DefaultAddinsFolder);
			
			// Initialize the database after all paths have been set
			database = new AddinDatabase (engine, this);
			
			// Get the domain corresponding to the startup folder
			if (startupDirectory != null && startupDirectory.Length > 0) {
				this.startupDirectory = Util.NormalizePath (startupDirectory);
				currentDomain = database.GetFolderDomain (null, this.startupDirectory);
			} else
				currentDomain = AddinDatabase.GlobalDomain;
		}
		public AddinUpdateData (AddinDatabase database)
		{
			this.database = database;
		}
		public AddinUpdateData (AddinDatabase database, IProgressStatus monitor)
		{
			this.monitor = monitor;
		}