Beispiel #1
0
        public AnnotationsLoader(SimpleExtensionManager extensionManager)
        {
            this.extensionManager = extensionManager;

            var location = FileSystemPath.CreateByCanonicalPath(Assembly.GetExecutingAssembly().Location)
                           .Directory.Combine("ExternalAnnotations");

            myAnnotations = new OneToSetMap <string, FileSystemPath>(StringComparer.OrdinalIgnoreCase);

            // Cache the annotation filenames to save scanning the directory multiple times.
            // Safe to cache as the user shouldn't be changing files in the install dir. If
            // they want to add extra annotations, use an extension.
            // The rules are simple: either the file is named after the assembly, or the folder
            // is (or both, but that doesn't matter)
            foreach (var file in location.GetChildFiles("*.xml"))
            {
                myAnnotations.Add(file.NameWithoutExtension, file);
            }
            foreach (var directory in location.GetChildDirectories())
            {
                foreach (var file in directory.GetChildFiles("*.xml", PathSearchFlags.RecurseIntoSubdirectories))
                {
                    myAnnotations.Add(file.NameWithoutExtension, file);
                    myAnnotations.Add(file.Directory.Name, file);
                }
            }
        }
 public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager, SimpleExtensionManager extensionManager)
 {
     // If we're installed as part of the extension manager, we don't need to worry about updates
     if (!extensionManager.IsInstalled())
     {
         Initialise(lifetime, updatesManager);
     }
 }
        public SettingsLoader(Lifetime lifetime, SimpleExtensionManager extensionManager,
                              UserInjectedSettingsLayers userInjectedSettingsLayers, IThreading threading,
                              IFileSystemTracker filetracker, FileSettingsStorageBehavior behavior)
        {
            // Check to see if we've been loaded as an extension - so we're either loaded
            // as a plugin on the command line (debugging) or we're in an environment that
            // doesn't support the default extension provider (e.g. VS2008)
            if (extensionManager.IsInstalled())
                return;

            var files = GetSettingsFiles();
            foreach (var file in files)
            {
                MountSettingsFile(lifetime, extensionManager.ExtensionId, file,
                    extensionManager.SettingsMountPointId, threading, filetracker,
                    behavior, userInjectedSettingsLayers);
            }
        }
Beispiel #4
0
        public SettingsLoader(Lifetime lifetime, SimpleExtensionManager extensionManager,
                              UserInjectedSettingsLayers userInjectedSettingsLayers, IThreading threading,
                              IFileSystemTracker filetracker, FileSettingsStorageBehavior behavior)
        {
            // Check to see if we've been loaded as an extension - so we're either loaded
            // as a plugin on the command line (debugging) or we're in an environment that
            // doesn't support the default extension provider (e.g. VS2008)
            if (extensionManager.IsInstalled())
            {
                return;
            }

            var files = GetSettingsFiles();

            foreach (var file in files)
            {
                MountSettingsFile(lifetime, extensionManager.ExtensionId, file,
                                  extensionManager.SettingsMountPointId, threading, filetracker,
                                  behavior, userInjectedSettingsLayers);
            }
        }
        public AnnotationsLoader(SimpleExtensionManager extensionManager)
        {
            this.extensionManager = extensionManager;

            var location = FileSystemPath.CreateByCanonicalPath(Assembly.GetExecutingAssembly().Location)
                .Directory.Combine("ExternalAnnotations");
            myAnnotations = new OneToSetMap<string, FileSystemPath>(StringComparer.OrdinalIgnoreCase);

            // Cache the annotation filenames to save scanning the directory multiple times.
            // Safe to cache as the user shouldn't be changing files in the install dir. If
            // they want to add extra annotations, use an extension.
            // The rules are simple: either the file is named after the assembly, or the folder
            // is (or both, but that doesn't matter)
            foreach (var file in location.GetChildFiles("*.xml"))
                myAnnotations.Add(file.NameWithoutExtension, file);
            foreach (var directory in location.GetChildDirectories())
            {
                foreach (var file in directory.GetChildFiles("*.xml", PathSearchFlags.RecurseIntoSubdirectories))
                {
                    myAnnotations.Add(file.NameWithoutExtension, file);
                    myAnnotations.Add(file.Directory.Name, file);
                }
            }
        }
 public UpdatesNotifier(Lifetime lifetime, UpdatesManager updatesManager, SimpleExtensionManager extensionManager)
 {
     // If we're installed as part of the extension manager, we don't need to worry about updates
     if (!extensionManager.IsInstalled())
         Initialise(lifetime, updatesManager);
 }