private static bool IsLiveUnitTestingRunning() { return(ShellUtil.IsCommandAvailable("Test.LiveUnitTesting.Stop")); }
/// <summary> /// This function is the callback used to execute the command when the menu item is clicked. /// See the constructor to see how the menu item is associated with this function using /// OleMenuCommandService service and MenuCommand class. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event args.</param> private void MenuItemCallback(object sender, EventArgs e) { MenuCommand command = (MenuCommand)sender; bool newCheckedState = !command.Checked; // Dispatch the action switch (command.CommandID.ID) { case Constants.ToggleIndicatorMarginCmdId: UpdateSetting("TextEditor", "General", "MarginIndicatorBar", newCheckedState); break; case Constants.ToggleLineNumbersCmdId: UpdateSetting("TextEditor", "AllLanguages", "ShowLineNumbers", newCheckedState); break; //case Constants.ToggleQuickActionsCmdId: // HandleToggleLightbulbMarginAction(sender, newCheckedState); // break; case Constants.ToggleSelectionMarginCmdId: UpdateSetting("TextEditor", "General", "SelectionMargin", newCheckedState); break; case Constants.ToggleTrackChangesCmdId: UpdateSetting("TextEditor", "General", "TrackChanges", newCheckedState); break; case Constants.ToggleDiffMarginCmdId: // TODO: Implement this break; case Constants.ToggleOutliningCmdId: if (newCheckedState) { ShellUtil.ExecuteCommand("Edit.StartAutomaticOutlining"); } else { ShellUtil.ExecuteCommand("Edit.StopOutlining"); } break; case Constants.ToggleLiveUnitTestingCmdId: ToggleLiveUnitTesting.ToggleLUT(sender, e); break; case Constants.ToggleAnnotateCmdId: //UpdateSetting("TextEditor", "AllLanguages", "ShowBlame", newCheckedState); // TODO: Get this working break; // Editor Settings //case Constants.ToggleNavigationBarCmdId: // UpdateSetting("TextEditor", "AllLanguages", "ShowNavigationBar", newCheckedState); // command.Checked = newCheckedState; // break; case Constants.ToggleCodeLensCmdId: HandleToggleCodeLensAction(sender, newCheckedState); break; //case Constants.ToggleStructureGuideLinesCmdId: // UpdateSetting("TextEditor", "General", "IndentGuides", newCheckedState); // command.Checked = newCheckedState; // break; case Constants.ToggleHighlightCurrentLineCmdId: UpdateSetting("TextEditor", "General", "HighlightCurrentLine", newCheckedState); break; case Constants.ToggleAutoDelimiterHighlightingCmdId: UpdateSetting("TextEditor", "General", "AutoDelimiterHighlighting", newCheckedState); command.Checked = newCheckedState; break; case Constants.ToggleProcedureLineSeparatorCmdId: UpdateSetting("TextEditor", "CSharp-Specific", "DisplayLineSeparators", newCheckedState); command.Checked = newCheckedState; break; case Constants.ToggleIntelliSensePopUpCmdId: UpdateSetting("TextEditor", "AllLanguages", "AutoListMembers", newCheckedState); UpdateSetting("TextEditor", "AllLanguages", "AutoListParams", newCheckedState); break; case Constants.ToggleLineEndingsCmdId: UpdateSetting("TextEditor", "General", "LineEndings", newCheckedState); command.Checked = newCheckedState; break; case Constants.ToggleHighlightSymbolsCmdId: UpdateSetting("TextEditor", "CSharp-Specific", "HighlightReferences", newCheckedState); command.Checked = newCheckedState; break; case Constants.ToggleHighlightKeywordsCmdId: UpdateSetting("TextEditor", "CSharp-Specific", "EnableHighlightRelatedKeywords", newCheckedState); command.Checked = newCheckedState; break; //case Constants.ToggleIntelliSenseSquigglesCmdId: //UpdateSetting("TextEditor", "Basic", "TrackChanges", newCheckedState); //break; // Scrollbar Settings case Constants.ToggleShowScrollbarMarkersCmdId: UpdateSetting("TextEditor", "CSharp", "ShowAnnotations", newCheckedState); // Turns off all scrollbar markers break; case Constants.ToggleShowChangesCmdId: UpdateSetting("TextEditor", "CSharp", "ShowChanges", newCheckedState); break; case Constants.ToggleShowMarksCmdId: UpdateSetting("TextEditor", "CSharp", "ShowMarks", newCheckedState); break; case Constants.ToggleShowErrorsCmdId: UpdateSetting("TextEditor", "CSharp", "ShowErrors", newCheckedState); break; case Constants.ToggleShowCaretPositionCmdId: UpdateSetting("TextEditor", "CSharp", "ShowCaretPosition", newCheckedState); break; case Constants.ToggleShowDiffsCmdId: // Not implemented yet. Would hook into Git Diff Margin scrollbar setting. break; case Constants.ToggleCleanEditorCmdId: ExecuteToggleCleanEditor(); break; case Constants.ToggleCleanMarginsCmdId: MessageBox.Show("Toggle Margins"); // Not implemented yet. Would turn off all visible margins, or restore all previously visible margins break; } // Update state of checkbox //command.Checked = newCheckedState; }