Esempio n. 1
0
 internal void NotifyDatabaseUpdated()
 {
     if (startupDirectory != null)
     {
         currentDomain = database.GetFolderDomain(null, startupDirectory);
     }
 }
Esempio n. 2
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;
            }
        }
Esempio n. 3
0
 internal void ResetCachedData()
 {
     // The domain may have changed
     if (sourceFile != null)
     {
         domain = database.GetFolderDomain(null, Path.GetDirectoryName(sourceFile));
     }
     desc  = null;
     addin = null;
 }
Esempio n. 4
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;
            }
        }