Beispiel #1
0
 internal Addin(AddinDatabase database, string domain, string id)
 {
     this.database = database;
     this.id       = id;
     this.domain   = domain;
     LoadAddinInfo();
 }
        public AddinScanner(AddinDatabase database, AddinScanResult scanResult, IProgressStatus monitor)
        {
            this.database = database;
            if (!scanResult.CheckOnly)
            {
                string refName = GetType().Assembly.FullName;
                int    i       = refName.IndexOf(',');
                refName = "Mono.Addins.CecilReflector.Reflector, Mono.Addins.CecilReflector" + refName.Substring(i);
                Type 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 AddinRegistry(string registryPath, string startupDirectory)
 {
     basePath  = Util.GetFullPath(registryPath);
     database  = new AddinDatabase(this);
     addinDirs = new StringCollection();
     addinDirs.Add(Path.Combine(basePath, "addins"));
 }
        public AddinScanDataFileGenerator(AddinDatabase database, AddinRegistry registry, string rootFolder) : base(database)
        {
            this.database   = database;
            this.rootFolder = Path.GetFullPath(rootFolder);

            assemblyIndex = new AssemblyIndex();
            locator       = new AssemblyLocator(database, registry, assemblyIndex);
            scanner       = new AddinScanner(database, locator);
        }
Beispiel #5
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;
            }
        }
Beispiel #6
0
        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(DefaultAddinsFolder);

            // Get the domain corresponding to the startup folder
            if (startupDirectory != null && startupDirectory.Length > 0)
            {
                this.startupDirectory = startupDirectory;
                currentDomain         = database.GetFolderDomain(null, startupDirectory);
            }
            else
            {
                currentDomain = AddinDatabase.GlobalDomain;
            }
        }
 public AssemblyLocator(AddinDatabase database, AddinRegistry registry, AssemblyIndex index)
 {
     this.index    = index;
     globalLocator = new AssemblyLocatorVisitor(database, registry, false);
 }
Beispiel #8
0
 public AddinUpdateData(AddinDatabase database)
 {
     this.database = database;
 }
 public AddinRegistryUpdater(AddinDatabase database, AddinScanResult scanResult) : base(database)
 {
     this.database   = database;
     this.scanResult = scanResult;
     ScanContext     = scanResult.ScanContext;
 }
 public AddinScanner(AddinDatabase database)
 {
     this.database = database;
 }
Beispiel #11
0
 internal Addin(AddinDatabase database, string file)
 {
     this.database = database;
     configFile    = file;
 }
Beispiel #12
0
 public AssemblyLocatorVisitor(AddinDatabase database, AddinRegistry registry, bool usePreScanDataFiles) : base(database)
 {
     this.registry            = registry;
     this.usePreScanDataFiles = usePreScanDataFiles;
 }
 public AddinFolderVisitor(AddinDatabase database)
 {
     this.database = database;
 }
 public AddinUpdateData(AddinDatabase database, IProgressStatus monitor)
 {
     this.monitor = monitor;
 }
Beispiel #15
0
 internal Addin(AddinDatabase database, string hostId, string hostSourceFile)
 {
     this.database   = database;
     this.hostId     = hostId;
     this.sourceFile = hostSourceFile;
 }