Exemple #1
0
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            CompareDirectoriesCommand.Initialize(this);
            base.Initialize();

            using (ServiceProvider serviceProvider = new ServiceProvider((IServiceProvider)(Package.GetGlobalService(typeof(IServiceProvider)))))
            {
                SettingsManager settingsManager = new ShellSettingsManager(serviceProvider);
                SettingsStore   settingsStore   = settingsManager.GetReadOnlySettingsStore(SettingsScope.UserSettings);

                if (settingsStore.CollectionExists(FilterSettings))
                {
                    IEnumerable <string> propertyNames = settingsStore.GetPropertyNames(FilterSettings);

                    foreach (string propertyName in propertyNames)
                    {
                        var filter = settingsStore.GetString(FilterSettings, propertyName, null);
                        if (filter != null)
                        {
                            CommonFilters.Add(filter);
                        }
                    }
                }
            }

            if (CommonFilters.Count == 0)
            {
                CommonFilters.Add("-*.dll;-*.pdb;-*.obj;-*.exe;-*.vsix;-.vs\\*;-*obj\\*;-*bin\\*;-.git\\*;-packages\\*");
                CommonFilters.Add("*.cs;*.vb;*.c;*.cpp;*.h");
                CommonFilters.Add(string.Empty);
            }
        }
Exemple #2
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 public static void Initialize(Package package)
 {
     Instance = new CompareDirectoriesCommand(package);
 }