/// <summary>
        /// Initializes a new instance of the <see cref="VSShortcutsManager"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private VSShortcutsManager(Package package)
        {
            this.package = package ?? throw new ArgumentNullException("package");

            // Intialize the VSShortcutQueryEngine
            this.queryEngine = VSShortcutQueryEngine.GetInstance(ServiceProvider);

            // Register all the command handlers with the Global Command Service
            RegisterCommandHandlers();

            //ShellSettingsManager = new ShellSettingsManager(package);
            userShortcutsManager = UserShortcutsManager.Instance;

            //// Initialise path for AppDataRoaming and AppDataLocal (Optional - alternative method)
            //_RoamingAppDataVSPath = Path.Combine(ShellSettingsManager.GetApplicationDataFolder(ApplicationDataFolder.ApplicationExtensions), "Extensions");
            //_LocalUserExtensionsPath = Path.Combine(ShellSettingsManager.GetApplicationDataFolder(ApplicationDataFolder.LocalSettings), "Extensions");

            // Load user shortcut registries
            //userShortcutsManager.DeleteUserShortcutsDef("WindowHideShortcuts");
            //UserShortcutsRegistry = userShortcutsManager.GetUserShortcutsRegistry();
            // Load imported VSKs registry
            //VskImportsRegistry = userShortcutsManager.GetVskImportsRegistry();

            if (ShortcutsScanner.Instance.ExtensionsNeedRescan())
            {
                ShortcutsScanner.Instance.ScanForAllExtensionShortcuts();
            }
        }
 private void InitializeShortcutEngine(IServiceProvider serviceProvider)
 {
     if (ShortcutQueryEngine == null)
     {
         ShortcutQueryEngine = VSShortcutQueryEngine.GetInstance(serviceProvider);
     }
 }
Beispiel #3
0
        public CommandShortcutsControlDataContext(IServiceProvider serviceProvider)
        {
            this.serviceProvider = serviceProvider;

            this.queryEngine = VSShortcutQueryEngine.GetInstance(this.serviceProvider);

            this.PopulateCommands();
        }