protected override void Initialize() { base.Initialize(); OleMenuCommandService menuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (menuCommandService != null) { // This is the drop down combo box itself /* * CommandID comboBoxCommandID = new DebugCommandLineCommandID(DebugCommandLineCommand.DebugCommandLineCombo); * OleMenuCommand comboBoxCommand = new OleMenuCommand(HandleInvokeCombo, HandleChangeCombo, HandleBeforeQueryStatusCombo, comboBoxCommandID); * menuCommandService.AddCommand(comboBoxCommand);*/ // This is the special command to get the list of drop down items /*CommandID comboBoxGetListCommandID = new DebugCommandLineCommandID(DebugCommandLineCommand.DebugCommandLineComboGetList); * OleMenuCommand comboBoxGetListCommand = new OleMenuCommand(HandleInvokeComboGetList, comboBoxGetListCommandID); * menuCommandService.AddCommand(comboBoxGetListCommand);*/ // This MRU combo box contains an editable text-field and a drop down menu which is saved on an application and user basis CommandID comboBoxCommandID = new DebugCommandLineCommandID(DebugCommandLineCommand.DebugCommandLineCombo); OleMenuCommand comboBoxCommand = new OleMenuCommand(new EventHandler(HandleOnMRUCombo), comboBoxCommandID); menuCommandService.AddCommand(comboBoxCommand); } /*var shellSettingsManager = new ShellSettingsManager(this); * SettingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); * LoadSettings();*/ }
private void HandleBeforeQueryStatusCombo(object sender, EventArgs e) { OleMenuCommand command = sender as OleMenuCommand; if (command == null) { return; } DebugCommandLineCommandID commandID = command.CommandID as DebugCommandLineCommandID; if (commandID == null || commandID.ID != DebugCommandLineCommand.DebugCommandLineCombo) { return; } command.Supported = true; try { command.Enabled = !string.IsNullOrEmpty(TryGetStartupCommandArgumentsPropertyName()); } catch (Exception ex) { if (ErrorHandler.IsCriticalException(ex)) { throw; } command.Enabled = false; } }
protected override void Initialize() { base.Initialize(); OleMenuCommandService menuCommandService = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (menuCommandService != null) { // This is the drop down combo box itself CommandID comboBoxCommandID = new DebugCommandLineCommandID(DebugCommandLineCommand.DebugCommandLineCombo); OleMenuCommand comboBoxCommand = new OleMenuCommand(HandleInvokeCombo, HandleChangeCombo, HandleBeforeQueryStatusCombo, comboBoxCommandID); menuCommandService.AddCommand(comboBoxCommand); // This is the special command to get the list of drop down items CommandID comboBoxGetListCommandID = new DebugCommandLineCommandID(DebugCommandLineCommand.DebugCommandLineComboGetList); OleMenuCommand comboBoxGetListCommand = new OleMenuCommand(HandleInvokeComboGetList, comboBoxGetListCommandID); menuCommandService.AddCommand(comboBoxGetListCommand); } var shellSettingsManager = new ShellSettingsManager(this); SettingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); LoadSettings(); }