public static void AddSettingsCommand(this IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, EditMenuHandler treeViewCmd, CodeContextMenuHandler textEditorCmd) { if (treeViewCmd != null) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENT_TREEVIEW); cmds.Add(SettingsRoutedCommand, new EditMenuHandlerCommandProxy(treeViewCmd)); } if (textEditorCmd != null) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); cmds.Add(SettingsRoutedCommand, new CodeContextMenuHandlerCommandProxy(textEditorCmd, documentTabService), ModifierKeys.Alt, Key.Enter); } }
ExceptionsContentCommandLoader(IWpfCommandService wpfCommandService, Lazy <IExceptionsContent> exceptionsContent, CopyCallExceptionsCtxMenuCommand copyCmd, AddExceptionsCtxMenuCommand addExCmd, RemoveExceptionsCtxMenuCommand removeExCmd, ToggleEnableExceptionsCtxMenuCommand toggleExCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW); cmds.Add(ApplicationCommands.Copy, new ExceptionsCtxMenuCommandProxy(copyCmd)); cmds.Add(new ExceptionsCtxMenuCommandProxy(addExCmd), ModifierKeys.None, Key.Insert); cmds.Add(new ExceptionsCtxMenuCommandProxy(removeExCmd), ModifierKeys.None, Key.Delete); cmds.Add(new ExceptionsCtxMenuCommandProxy(toggleExCmd), ModifierKeys.None, Key.Space); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL); cmds.Add(new RelayCommand(a => exceptionsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => exceptionsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
GoToTokenLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService) { this.documentTabService = documentTabService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); cmds.Add(GoToToken, (s, e) => GoToTokenCommand.ExecuteInternal(documentTabService), (s, e) => e.CanExecute = GoToTokenCommand.CanExecuteInternal(documentTabService), ModifierKeys.Control, Key.D); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENT_TREEVIEW); cmds.Add(GoToToken, (s, e) => GoToTokenCommand.ExecuteInternal(documentTabService), (s, e) => e.CanExecute = GoToTokenCommand.CanExecuteInternal(documentTabService), ModifierKeys.Control, Key.D); }
ThreadsCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IThreadsContent> threadsContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_THREADS_LISTVIEW); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.Copy(), a => threadsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.Copy(), a => threadsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.SwitchToThread(newTab: false), a => threadsContent.Value.Operations.CanSwitchToThread), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.SwitchToThread(newTab: true), a => threadsContent.Value.Operations.CanSwitchToThread), ModifierKeys.Control, Key.Enter); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.SwitchToThread(newTab: true), a => threadsContent.Value.Operations.CanSwitchToThread), ModifierKeys.Shift, Key.Enter); cmds.Add(new RelayCommand(a => threadsContent.Value.Operations.RenameThread(), a => threadsContent.Value.Operations.CanRenameThread), ModifierKeys.None, Key.F2); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_THREADS_CONTROL); cmds.Add(new RelayCommand(a => threadsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => threadsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
CodeBreakpointsCommandsLoader(IWpfCommandService wpfCommandService, Lazy <ICodeBreakpointsContent> codeBreakpointsContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_CODEBREAKPOINTS_LISTVIEW); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.Copy(), a => codeBreakpointsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.Copy(), a => codeBreakpointsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.RemoveCodeBreakpoints(), a => codeBreakpointsContent.Value.Operations.CanRemoveCodeBreakpoints), ModifierKeys.None, Key.Delete); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.GoToSourceCode(false), a => codeBreakpointsContent.Value.Operations.CanGoToSourceCode), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.EditSettings(), a => codeBreakpointsContent.Value.Operations.CanEditSettings), ModifierKeys.Alt, Key.Enter); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.Operations.EditLabels(), a => codeBreakpointsContent.Value.Operations.CanEditLabels), ModifierKeys.None, Key.F2); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_CODEBREAKPOINTS_CONTROL); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => codeBreakpointsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
ProcessesCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IProcessesContent> processesContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_PROCESSES_LISTVIEW); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.Copy(), a => processesContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.Copy(), a => processesContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.AttachToProcess(), a => processesContent.Value.Operations.CanAttachToProcess), ModifierKeys.Control | ModifierKeys.Alt, Key.P); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.SetCurrentProcess(newTab: false), a => processesContent.Value.Operations.CanSetCurrentProcess), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.SetCurrentProcess(newTab: true), a => processesContent.Value.Operations.CanSetCurrentProcess), ModifierKeys.Control, Key.Enter); cmds.Add(new RelayCommand(a => processesContent.Value.Operations.SetCurrentProcess(newTab: true), a => processesContent.Value.Operations.CanSetCurrentProcess), ModifierKeys.Shift, Key.Enter); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_PROCESSES_CONTROL); cmds.Add(new RelayCommand(a => processesContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => processesContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
BookmarksCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IBookmarksContent> bookmarksContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_BOOKMARKS_LISTVIEW); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.Copy(), a => bookmarksContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.Copy(), a => bookmarksContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.RemoveBookmarks(), a => bookmarksContent.Value.Operations.CanRemoveBookmarks), ModifierKeys.None, Key.Delete); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.GoToLocation(false), a => bookmarksContent.Value.Operations.CanGoToLocation), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.EditName(), a => bookmarksContent.Value.Operations.CanEditName), ModifierKeys.None, Key.F2); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.EditName(), a => bookmarksContent.Value.Operations.CanEditName), ModifierKeys.Control, Key.D1); cmds.Add(new RelayCommand(a => bookmarksContent.Value.Operations.EditLabels(), a => bookmarksContent.Value.Operations.CanEditLabels), ModifierKeys.Control, Key.D2); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_BOOKMARKS_CONTROL); cmds.Add(new RelayCommand(a => bookmarksContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => bookmarksContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
RemoveAnalyzeCommand(IWpfCommandService wpfCommandService, Lazy <IAnalyzerService> analyzerService) { this.analyzerService = analyzerService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); cmds.Add(ApplicationCommands.Delete, (s, e) => DeleteNodes(), (s, e) => e.CanExecute = CanDeleteNodes, ModifierKeys.None, Key.Delete); }
ShowCSharpInteractiveCommandLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(ShowCSharpInteractiveRoutedCommand, (s, e) => toolWindowService.Show(CSharpToolWindowContent.THE_GUID), (s, e) => e.CanExecute = true); cmds.Add(ShowCSharpInteractiveRoutedCommand, ModifierKeys.Control | ModifierKeys.Alt, Key.N); }
ShowDocumentTreeViewCommandLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW).Add( ShowDocumentTreeViewRoutedCommand, (s, e) => toolWindowService.Show(DocumentTreeViewWindowContent.THE_GUID), (s, e) => e.CanExecute = true, ModifierKeys.Control | ModifierKeys.Alt, Key.L); }
ExceptionsCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IExceptionsContent> exceptionsContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.Copy(), a => exceptionsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.Copy(), a => exceptionsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.AddException(), a => exceptionsContent.Value.Operations.CanAddException), ModifierKeys.None, Key.Insert); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.RemoveExceptions(), a => exceptionsContent.Value.Operations.CanRemoveExceptions), ModifierKeys.None, Key.Delete); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.EditConditions(), a => exceptionsContent.Value.Operations.CanEditConditions), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.EditConditions(), a => exceptionsContent.Value.Operations.CanEditConditions), ModifierKeys.Alt, Key.Enter); cmds.Add(new RelayCommand(a => exceptionsContent.Value.Operations.ToggleBreakWhenThrown(), a => exceptionsContent.Value.Operations.CanToggleBreakWhenThrown), ModifierKeys.None, Key.Space); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL); cmds.Add(new RelayCommand(a => exceptionsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => exceptionsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
SearchCommandLoader(IDsToolWindowService toolWindowService, Lazy<ISearchService> searchService, IWpfCommandService wpfCommandService) { this.toolWindowService = toolWindowService; this.searchService = searchService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(SearchRoutedCommand, Search, CanSearch); }
CallStackCommandLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(DebugRoutedCommands.ShowLocals, new RelayCommand(a => toolWindowService.Show(LocalsToolWindowContent.THE_GUID))); cmds.Add(DebugRoutedCommands.ShowLocals, ModifierKeys.Alt, Key.D4); }
SaveModuleCommandLoader(IWpfCommandService wpfCommandService, Lazy<IUndoCommandService> undoCommandService, Lazy<IDocumentSaver> documentSaver) { this.undoCommandService = undoCommandService; this.documentSaver = documentSaver; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(SaveAllCommand, (s, e) => SaveAll_Execute(), (s, e) => e.CanExecute = SaveAll_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.S); }
ToolWindowLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(OpenToolWindow, new RelayCommand(a => toolWindowService.Show(ToolWindowContentImpl.THE_GUID))); cmds.Add(OpenToolWindow, ModifierKeys.Control | ModifierKeys.Alt, Key.Z); }
ToolWindowsLoader(IWpfCommandService wpfCommandService, Lazy <ToolWindowsOperations> toolWindowsOperations) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowCodeBreakpoints(), a => toolWindowsOperations.Value.CanShowCodeBreakpoints), ModifierKeys.Control | ModifierKeys.Alt, Key.B); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowCodeBreakpoints(), a => toolWindowsOperations.Value.CanShowCodeBreakpoints), ModifierKeys.Alt, Key.F9); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowCallStack(), a => toolWindowsOperations.Value.CanShowCallStack), ModifierKeys.Control | ModifierKeys.Alt, Key.C); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowCallStack(), a => toolWindowsOperations.Value.CanShowCallStack), ModifierKeys.Alt, Key.D7); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowCallStack(), a => toolWindowsOperations.Value.CanShowCallStack), ModifierKeys.Alt, Key.NumPad7); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowThreads(), a => toolWindowsOperations.Value.CanShowThreads), ModifierKeys.Control | ModifierKeys.Alt, Key.H); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowModules(), a => toolWindowsOperations.Value.CanShowModules), ModifierKeys.Control | ModifierKeys.Alt, Key.U); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowExceptions(), a => toolWindowsOperations.Value.CanShowExceptions), ModifierKeys.Control | ModifierKeys.Alt, Key.E); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowProcesses(), a => toolWindowsOperations.Value.CanShowProcesses), ModifierKeys.Control | ModifierKeys.Alt, Key.Z); cmds.Add(new RelayCommand(a => toolWindowsOperations.Value.ShowLocals(), a => toolWindowsOperations.Value.CanShowLocals), ModifierKeys.Alt, Key.D4); for (int i = 0; i < Memory.MemoryWindowsHelper.NUMBER_OF_MEMORY_WINDOWS && i < 10; i++) { int index = i; var cmd = new RelayCommand(a => toolWindowsOperations.Value.ShowMemory(index), a => toolWindowsOperations.Value.CanShowMemory(index)); if (i == 0) { cmds.Add(cmd, ModifierKeys.Alt, Key.D6); } cmds.Add(cmd, ModifierKeys.Control | ModifierKeys.Shift, Key.D0 + (i + 1) % 10); } }
CommandLoader(IWpfCommandService wpfCommandService, MySettings mySettings) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); // This command will be added to all text editors cmds.Add(Option1Command, (s, e) => mySettings.BoolOption1 = !mySettings.BoolOption1, (s, e) => e.CanExecute = true, ModifierKeys.Control | ModifierKeys.Alt, Key.Q); }
BreakpointsContentCommandLoader(IWpfCommandService wpfCommandService, Lazy <IAnalyzerService> analyzerService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); cmds.Add(ApplicationCommands.Copy, (s, e) => CopyCtxMenuCommand.ExecuteInternal(analyzerService), (s, e) => e.CanExecute = CopyCtxMenuCommand.CanExecuteInternal(analyzerService)); }
CommandLoader(IWpfCommandService wpfCommandService, EditBodyCommand editBodyCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); ICommand editBodyCmd2 = editBodyCmd; cmds.Add(EditBodyCommand, (s, e) => editBodyCmd2.Execute(null), (s, e) => e.CanExecute = editBodyCmd2.CanExecute(null), ModifierKeys.Control | ModifierKeys.Shift, Key.E); }
OpenFromGacCommandLoader(IOpenFromGAC openFromGAC, IWpfCommandService wpfCommandService) { this.openFromGAC = openFromGAC; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(OpenFromGac, (s, e) => Execute(), (s, e) => e.CanExecute = true, ModifierKeys.Control | ModifierKeys.Shift, Key.O); }
CopyILBytesLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, Lazy <IMethodAnnotations> methodAnnotations) { this.documentTabService = documentTabService; this.methodAnnotations = methodAnnotations; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); cmds.Add(CopyILBytesCommand, CopyILBytesExecuted, CopyILBytesCanExecute, ModifierKeys.Control, Key.B); }
ThreadsContentCommandLoader(IWpfCommandService wpfCommandService, CopyCallThreadsCtxMenuCommand copyCmd, SwitchToThreadThreadsCtxMenuCommand switchCmd, SwitchToThreadNewTabThreadsCtxMenuCommand switchNewTabCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_THREADS_LISTVIEW); cmds.Add(ApplicationCommands.Copy, new ThreadsCtxMenuCommandProxy(copyCmd)); cmds.Add(new ThreadsCtxMenuCommandProxy(switchCmd), ModifierKeys.None, Key.Enter); cmds.Add(new ThreadsCtxMenuCommandProxy(switchNewTabCmd), ModifierKeys.Control, Key.Enter); cmds.Add(new ThreadsCtxMenuCommandProxy(switchNewTabCmd), ModifierKeys.Shift, Key.Enter); }
ShowOutputWindowCommandLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(ShowOutputWindowRoutedCommand, (s, e) => toolWindowService.Show(OutputToolWindowContent.THE_GUID), (s, e) => e.CanExecute = true); cmds.Add(ShowOutputWindowRoutedCommand, ModifierKeys.Alt, Key.D2); }
BreakpointsContentCommandLoader(IWpfCommandService wpfCommandService, CopyBreakpointCtxMenuCommand copyCmd, DeleteBreakpointCtxMenuCommand deleteCmd, GoToSourceBreakpointCtxMenuCommand gotoSrcCmd, GoToSourceNewTabBreakpointCtxMenuCommand gotoSrcNewTabCmd, ToggleEnableBreakpointCtxMenuCommand toggleBpCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_BREAKPOINTS_LISTVIEW); cmds.Add(ApplicationCommands.Copy, new BreakpointCtxMenuCommandProxy(copyCmd)); cmds.Add(ApplicationCommands.Delete, new BreakpointCtxMenuCommandProxy(deleteCmd)); cmds.Add(new BreakpointCtxMenuCommandProxy(gotoSrcCmd), ModifierKeys.None, Key.Enter); cmds.Add(new BreakpointCtxMenuCommandProxy(gotoSrcNewTabCmd), ModifierKeys.Control, Key.Enter); cmds.Add(new BreakpointCtxMenuCommandProxy(gotoSrcNewTabCmd), ModifierKeys.Shift, Key.Enter); cmds.Add(new BreakpointCtxMenuCommandProxy(toggleBpCmd), ModifierKeys.None, Key.Space); }
SaveModuleCommandLoader(IWpfCommandService wpfCommandService, Lazy <IUndoCommandService> undoCommandService, Lazy <IDocumentSaver> documentSaver) { this.undoCommandService = undoCommandService; this.documentSaver = documentSaver; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(SaveAllCommand, (s, e) => SaveAll_Execute(), (s, e) => e.CanExecute = SaveAll_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.S); }
ShowVisualBasicInteractiveCommandLoader(IWpfCommandService wpfCommandService, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(ShowVisualBasicInteractiveRoutedCommand, (s, e) => toolWindowService.Show(VisualBasicToolWindowContent.THE_GUID), (s, e) => e.CanExecute = true); cmds.Add(ShowVisualBasicInteractiveRoutedCommand, ModifierKeys.Control | ModifierKeys.Alt, Key.I); }
ModuleBreakpointsCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IModuleBreakpointsContent> moduleBreakpointsContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_MODULEBREAKPOINTS_LISTVIEW); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.Copy(), a => moduleBreakpointsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.Copy(), a => moduleBreakpointsContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.EditModuleName(), a => moduleBreakpointsContent.Value.Operations.CanEditModuleName), ModifierKeys.None, Key.F2); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.EditModuleName(), a => moduleBreakpointsContent.Value.Operations.CanEditModuleName), ModifierKeys.Control, Key.D1); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.EditOrder(), a => moduleBreakpointsContent.Value.Operations.CanEditOrder), ModifierKeys.Control, Key.D2); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.EditProcessName(), a => moduleBreakpointsContent.Value.Operations.CanEditProcessName), ModifierKeys.Control, Key.D3); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.EditAppDomainName(), a => moduleBreakpointsContent.Value.Operations.CanEditAppDomainName), ModifierKeys.Control, Key.D4); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.RemoveModuleBreakpoints(), a => moduleBreakpointsContent.Value.Operations.CanRemoveModuleBreakpoints), ModifierKeys.None, Key.Delete); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.Operations.AddModuleBreakpoint(), a => moduleBreakpointsContent.Value.Operations.CanAddModuleBreakpoint), ModifierKeys.None, Key.Insert); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_MODULEBREAKPOINTS_CONTROL); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => moduleBreakpointsContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
SearchCommandLoader(IDsToolWindowService toolWindowService, Lazy <ISearchService> searchService, IWpfCommandService wpfCommandService) { this.toolWindowService = toolWindowService; this.searchService = searchService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(SearchRoutedCommand, Search, CanSearch); }
CallStackContentCommandLoader(IWpfCommandService wpfCommandService, CopyCallStackCtxMenuCommand copyCmd, RunToCursorCallStackCtxMenuCommand runToCursorCmd, SwitchToFrameCallStackCtxMenuCommand switchToFrameCmd, SwitchToFrameNewTabCallStackCtxMenuCommand switchToFrameNewTabCmd) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_CALLSTACK_LISTVIEW); cmds.Add(ApplicationCommands.Copy, new CallStackCtxMenuCommandProxy(copyCmd)); cmds.Add(new CallStackCtxMenuCommandProxy(runToCursorCmd), ModifierKeys.Control, Key.F10); cmds.Add(new CallStackCtxMenuCommandProxy(switchToFrameCmd), ModifierKeys.None, Key.Enter); cmds.Add(new CallStackCtxMenuCommandProxy(switchToFrameNewTabCmd), ModifierKeys.Control, Key.Enter); cmds.Add(new CallStackCtxMenuCommandProxy(switchToFrameNewTabCmd), ModifierKeys.Shift, Key.Enter); }
UndoRedoCommmandLoader(IWpfCommandService wpfCommandService, Lazy<IUndoCommandService> undoCommandService, IAppWindow appWindow, IMessageBoxService messageBoxService) { this.undoCommandService = undoCommandService; this.messageBoxService = messageBoxService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(UndoRoutedCommands.Undo, (s, e) => undoCommandService.Value.Undo(), (s, e) => e.CanExecute = undoCommandService.Value.CanUndo); cmds.Add(UndoRoutedCommands.Redo, (s, e) => undoCommandService.Value.Redo(), (s, e) => e.CanExecute = undoCommandService.Value.CanRedo); appWindow.MainWindowClosing += AppWindow_MainWindowClosing; }
public DocumentTreeView(bool isGlobal, IDocumentTreeNodeFilter filter, ITreeViewService treeViewService, IDecompilerService decompilerService, IDsDocumentService documentService, IDocumentTreeViewSettings documentTreeViewSettings, IMenuService menuService, IDotNetImageService dotNetImageService, IWpfCommandService wpfCommandService, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable <Lazy <IDsDocumentNodeProvider, IDsDocumentNodeProviderMetadata> > dsDocumentNodeProvider, [ImportMany] IEnumerable <Lazy <IDocumentTreeNodeDataFinder, IDocumentTreeNodeDataFinderMetadata> > mefFinders, ITreeViewNodeTextElementProvider treeViewNodeTextElementProvider) { this.decompilerService = decompilerService; this.documentTreeViewSettings = documentTreeViewSettings; this.appSettings = appSettings; this.context = new DocumentTreeNodeDataContext(this, resourceNodeFactory, filter ?? FilterNothingDocumentTreeNodeFilter.Instance, treeViewNodeTextElementProvider) { SyntaxHighlight = documentTreeViewSettings.SyntaxHighlight, SingleClickExpandsChildren = documentTreeViewSettings.SingleClickExpandsTreeViewChildren, ShowAssemblyVersion = documentTreeViewSettings.ShowAssemblyVersion, ShowAssemblyPublicKeyToken = documentTreeViewSettings.ShowAssemblyPublicKeyToken, ShowToken = documentTreeViewSettings.ShowToken, Decompiler = decompilerService.Decompiler, UseNewRenderer = appSettings.UseNewRenderer_DocumentTreeView, DeserializeResources = documentTreeViewSettings.DeserializeResources, CanDragAndDrop = isGlobal, }; var options = new TreeViewOptions { AllowDrop = true, IsVirtualizing = true, VirtualizationMode = VirtualizationMode.Recycling, TreeViewListener = this, RootNode = new RootNode { DropNodes = OnDropNodes, DropFiles = OnDropFiles, }, }; this.documentTreeNodeGroups = new DocumentTreeNodeGroups(); this.dsDocumentNodeProvider = dsDocumentNodeProvider.OrderBy(a => a.Metadata.Order).ToArray(); this.TreeView = treeViewService.Create(new Guid(TreeViewConstants.DOCUMENT_TREEVIEW_GUID), options); this.TreeView.SelectionChanged += TreeView_SelectionChanged; this.DocumentService = documentService; this.DotNetImageService = dotNetImageService; this.dispatcher = Dispatcher.CurrentDispatcher; this.DocumentService.SetDispatcher(AddAction); documentService.CollectionChanged += DocumentService_CollectionChanged; decompilerService.DecompilerChanged += DecompilerService_DecompilerChanged; documentTreeViewSettings.PropertyChanged += DocumentTreeViewSettings_PropertyChanged; appSettings.PropertyChanged += AppSettings_PropertyChanged; this.WpfCommands = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENT_TREEVIEW); if (isGlobal) { menuService.InitializeContextMenu(this.TreeView.UIObject, new Guid(MenuConstants.GUIDOBJ_DOCUMENTS_TREEVIEW_GUID), new GuidObjectsProvider(this.TreeView)); wpfCommandService.Add(ControlConstants.GUID_DOCUMENT_TREEVIEW, TreeView.UIObject); } this.nodeFinders = mefFinders.OrderBy(a => a.Metadata.Order).ToArray(); InitializeDocumentTreeNodeGroups(); }
ModulesCommandsLoader(IWpfCommandService wpfCommandService, Lazy <IModulesContent> modulesContent) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_MODULES_LISTVIEW); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.Copy(), a => modulesContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.C); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.Copy(), a => modulesContent.Value.Operations.CanCopy), ModifierKeys.Control, Key.Insert); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.GoToModule(newTab: false), a => modulesContent.Value.Operations.CanGoToModule), ModifierKeys.None, Key.Enter); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.GoToModule(newTab: true), a => modulesContent.Value.Operations.CanGoToModule), ModifierKeys.Control, Key.Enter); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.GoToModule(newTab: true), a => modulesContent.Value.Operations.CanGoToModule), ModifierKeys.Shift, Key.Enter); cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.ShowInMemoryWindow(), a => modulesContent.Value.Operations.CanShowInMemoryWindow), ModifierKeys.Control, Key.X); for (int i = 0; i < MemoryWindowsHelper.NUMBER_OF_MEMORY_WINDOWS && i < 10; i++) { var windowIndex = i; cmds.Add(new RelayCommand(a => modulesContent.Value.Operations.ShowInMemoryWindow(windowIndex), a => modulesContent.Value.Operations.CanShowInMemoryWindow), ModifierKeys.Control, Key.D0 + (i + 1) % 10); } cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DEBUGGER_MODULES_CONTROL); cmds.Add(new RelayCommand(a => modulesContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.F); cmds.Add(new RelayCommand(a => modulesContent.Value.FocusSearchTextBox()), ModifierKeys.Control, Key.E); }
ShowCodeEditorCommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(ShowCodeEditorRoutedCommand, (s, e) => documentTabService.ActiveTab?.TrySetFocus(), (s, e) => e.CanExecute = documentTabService.ActiveTab != null, ModifierKeys.Control | ModifierKeys.Alt, Key.D0, ModifierKeys.Control | ModifierKeys.Alt, Key.NumPad0, ModifierKeys.None, Key.F7); cmds.Add(ShowCodeEditorRoutedCommand, ModifierKeys.None, Key.Escape); }
UndoRedoCommmandLoader(IWpfCommandService wpfCommandService, Lazy <IUndoCommandService> undoCommandService, IAppWindow appWindow, IMessageBoxService messageBoxService) { this.undoCommandService = undoCommandService; this.messageBoxService = messageBoxService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(UndoRoutedCommands.Undo, (s, e) => undoCommandService.Value.Undo(), (s, e) => e.CanExecute = undoCommandService.Value.CanUndo); cmds.Add(UndoRoutedCommands.Redo, (s, e) => undoCommandService.Value.Redo(), (s, e) => e.CanExecute = undoCommandService.Value.CanRedo); appWindow.MainWindowClosing += AppWindow_MainWindowClosing; }
MemoryContentCommandLoader(IWpfCommandService wpfCommandService, MemoryToolWindowContentProvider memoryToolWindowContentProvider, IDsToolWindowService toolWindowService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); for (int i = 0; i < DebugRoutedCommands.ShowMemoryCommands.Length; i++) { var info = memoryToolWindowContentProvider.Contents[i]; cmds.Add(DebugRoutedCommands.ShowMemoryCommands[i], new RelayCommand(a => toolWindowService.Show(info.Guid))); } for (int i = 0; i < DebugRoutedCommands.ShowMemoryCommands.Length && i < 10; i++) { var cmd = DebugRoutedCommands.ShowMemoryCommands[i]; if (i == 0) cmds.Add(cmd, ModifierKeys.Alt, Key.D6); cmds.Add(cmd, ModifierKeys.Control | ModifierKeys.Shift, Key.D0 + (i + 1) % 10); } }
AnalyzeCommandLoader(IDsToolWindowService toolWindowService, IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, Lazy<IAnalyzerService> analyzerService, IDecompilerService decompilerService) { this.toolWindowService = toolWindowService; this.documentTabService = documentTabService; this.analyzerService = analyzerService; this.decompilerService = decompilerService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); cmds.Add(AnalyzeRoutedCommand, TextEditor_Executed, TextEditor_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds.Add(AnalyzeRoutedCommand, ShowAnalyzerExecuted, ShowAnalyzerCanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENT_TREEVIEW); cmds.Add(AnalyzeRoutedCommand, DocumentTreeView_Executed, DocumentTreeView_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds.Add(AnalyzeRoutedCommand, ShowAnalyzerExecuted, ShowAnalyzerCanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); cmds.Add(AnalyzeRoutedCommand, AnalyzerTreeView_Executed, AnalyzerTreeView_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds.Add(AnalyzeRoutedCommand, ShowAnalyzerExecuted, ShowAnalyzerCanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds = wpfCommandService.GetCommands(ControlConstants.GUID_SEARCH_LISTBOX); cmds.Add(AnalyzeRoutedCommand, SearchListBox_Executed, SearchListBox_CanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); cmds.Add(AnalyzeRoutedCommand, ShowAnalyzerExecuted, ShowAnalyzerCanExecute, ModifierKeys.Control | ModifierKeys.Shift, Key.R); }
DebugServiceCommandLoader(Lazy<DebugService> debugService, IWpfCommandService wpfCommandService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); cmds.Add(DebugRoutedCommands.DebugCurrentAssembly, (s, e) => debugService.Value.DebugCurrentAssembly(e.Parameter), (s, e) => e.CanExecute = debugService.Value.CanDebugCurrentAssembly(e.Parameter)); cmds.Add(DebugRoutedCommands.DebugAssembly, (s, e) => debugService.Value.DebugAssembly(), (s, e) => e.CanExecute = debugService.Value.CanDebugAssembly); cmds.Add(DebugRoutedCommands.DebugCoreCLRAssembly, (s, e) => debugService.Value.DebugCoreCLRAssembly(), (s, e) => e.CanExecute = debugService.Value.CanDebugCoreCLRAssembly); cmds.Add(DebugRoutedCommands.StartWithoutDebugging, (s, e) => debugService.Value.StartWithoutDebugging(), (s, e) => e.CanExecute = debugService.Value.CanStartWithoutDebugging, ModifierKeys.Control, Key.F5); cmds.Add(DebugRoutedCommands.Attach, (s, e) => debugService.Value.Attach(), (s, e) => e.CanExecute = debugService.Value.CanAttach, ModifierKeys.Control | ModifierKeys.Alt, Key.P); cmds.Add(DebugRoutedCommands.Break, (s, e) => debugService.Value.Break(), (s, e) => e.CanExecute = debugService.Value.CanBreak, ModifierKeys.Control, Key.Cancel); cmds.Add(DebugRoutedCommands.Restart, (s, e) => debugService.Value.Restart(), (s, e) => e.CanExecute = debugService.Value.CanRestart, ModifierKeys.Control | ModifierKeys.Shift, Key.F5); cmds.Add(DebugRoutedCommands.Stop, (s, e) => debugService.Value.Stop(), (s, e) => e.CanExecute = debugService.Value.CanStop, ModifierKeys.Shift, Key.F5); cmds.Add(DebugRoutedCommands.Detach, (s, e) => debugService.Value.Detach(), (s, e) => e.CanExecute = debugService.Value.CanDetach); cmds.Add(DebugRoutedCommands.Continue, (s, e) => debugService.Value.Continue(), (s, e) => e.CanExecute = debugService.Value.CanContinue, ModifierKeys.None, Key.F5); cmds.Add(DebugRoutedCommands.StepInto, (s, e) => debugService.Value.StepInto(), (s, e) => e.CanExecute = debugService.Value.CanStepInto(), ModifierKeys.None, Key.F11); cmds.Add(DebugRoutedCommands.StepOver, (s, e) => debugService.Value.StepOver(), (s, e) => e.CanExecute = debugService.Value.CanStepOver(), ModifierKeys.None, Key.F10); cmds.Add(DebugRoutedCommands.StepOut, (s, e) => debugService.Value.StepOut(), (s, e) => e.CanExecute = debugService.Value.CanStepOut(), ModifierKeys.Shift, Key.F11); cmds.Add(DebugRoutedCommands.ShowNextStatement, (s, e) => debugService.Value.ShowNextStatement(), (s, e) => e.CanExecute = debugService.Value.CanShowNextStatement, ModifierKeys.Alt, Key.Multiply); cmds.Add(DebugRoutedCommands.SetNextStatement, (s, e) => debugService.Value.SetNextStatement(e.Parameter), (s, e) => e.CanExecute = debugService.Value.CanSetNextStatement(e.Parameter), ModifierKeys.Control | ModifierKeys.Shift, Key.F10); cmds.Add(DebugRoutedCommands.Continue, (s, e) => debugService.Value.DebugAssembly(), (s, e) => e.CanExecute = debugService.Value.CanDebugAssembly, ModifierKeys.None, Key.F5); cmds.Add(DebugRoutedCommands.StepInto, (s, e) => debugService.Value.DebugAssembly(), (s, e) => e.CanExecute = debugService.Value.CanDebugAssembly, ModifierKeys.None, Key.F11); cmds.Add(DebugRoutedCommands.StepOver, (s, e) => debugService.Value.DebugAssembly(), (s, e) => e.CanExecute = debugService.Value.CanDebugAssembly, ModifierKeys.None, Key.F10); }
SearchService(IDecompilerService decompilerService, ISearchSettings searchSettings, IDocumentSearcherProvider fileSearcherProvider, IMenuService menuService, IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, IClassificationFormatMapService classificationFormatMapService) { var classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.UIMisc); this.documentTabService = documentTabService; searchControl = new SearchControl(); vmSearch = new SearchControlVM(fileSearcherProvider, documentTabService.DocumentTreeView, searchSettings) { Decompiler = decompilerService.Decompiler, }; searchControl.DataContext = vmSearch; menuService.InitializeContextMenu(searchControl.ListBox, MenuConstants.GUIDOBJ_SEARCH_GUID, new GuidObjectsProvider()); wpfCommandService.Add(ControlConstants.GUID_SEARCH_CONTROL, searchControl); wpfCommandService.Add(ControlConstants.GUID_SEARCH_LISTBOX, searchControl.ListBox); decompilerService.DecompilerChanged += DecompilerService_DecompilerChanged; classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged; searchSettings.PropertyChanged += SearchSettings_PropertyChanged; documentTabService.DocumentTreeView.DocumentService.CollectionChanged += DocumentService_CollectionChanged; searchControl.SearchListBoxDoubleClick += (s, e) => FollowSelectedReference(); var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_SEARCH_LISTBOX); var command = new RelayCommand(a => FollowSelectedReference()); cmds.Add(command, ModifierKeys.None, Key.Enter); cmds.Add(command, ModifierKeys.Control, Key.Enter); cmds.Add(command, ModifierKeys.Shift, Key.Enter); Add(SearchType.TypeDef, Key.T); Add(SearchType.FieldDef, Key.F); Add(SearchType.MethodDef, Key.M); Add(SearchType.PropertyDef, Key.P); Add(SearchType.EventDef, Key.E); Add(SearchType.ParamDef, Key.J); Add(SearchType.Local, Key.I); Add(SearchType.ParamLocal, Key.N); Add(SearchType.Resource, Key.R); Add(SearchType.Member, Key.U); Add(SearchType.Any, Key.B); Add(SearchType.Literal, Key.L); Add(SearchLocation.AllFiles, Key.G); Add(SearchLocation.SelectedFiles, Key.S); Add(SearchLocation.AllFilesInSameDir, Key.D); Add(SearchLocation.SelectedType, Key.Q); }
AppWindow(ISettingsService settingsService, IDocumentTabService documentTabService, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandService wpfCommandService) { assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly); uiSettings = new UISettings(settingsService); uiSettings.Read(); stackedContent = new StackedContent<IStackedContentChild>(margin: new Thickness(6)); this.documentTabService = documentTabService; statusBar = new AppStatusBar(); this.appToolBar = appToolBar; this.mainWindowControl = mainWindowControl; this.wpfCommandService = wpfCommandService; mainWindowCommands = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW); mainWindowClosing = new WeakEventList<CancelEventArgs>(); mainWindowClosed = new WeakEventList<EventArgs>(); }
CopyILBytesLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, Lazy<IMethodAnnotations> methodAnnotations) { this.documentTabService = documentTabService; this.methodAnnotations = methodAnnotations; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT); cmds.Add(CopyILBytesCommand, CopyILBytesExecuted, CopyILBytesCanExecute, ModifierKeys.Control, Key.B); }
BreakpointsContentCommandLoader(IWpfCommandService wpfCommandService, Lazy<IAnalyzerService> analyzerService) { var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); cmds.Add(ApplicationCommands.Copy, (s, e) => CopyCtxMenuCommand.ExecuteInternal(analyzerService), (s, e) => e.CanExecute = CopyCtxMenuCommand.CanExecuteInternal(analyzerService)); }
RemoveAnalyzeCommand(IWpfCommandService wpfCommandService, Lazy<IAnalyzerService> analyzerService) { this.analyzerService = analyzerService; var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); cmds.Add(ApplicationCommands.Delete, (s, e) => DeleteNodes(), (s, e) => e.CanExecute = CanDeleteNodes, ModifierKeys.None, Key.Delete); }
AnalyzerService(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, ITreeViewService treeViewService, IMenuService menuService, IAnalyzerSettings analyzerSettings, IDotNetImageService dotNetImageService, IDecompilerService decompilerService, ITreeViewNodeTextElementProvider treeViewNodeTextElementProvider) { this.documentTabService = documentTabService; context = new AnalyzerTreeNodeDataContext { DotNetImageService = dotNetImageService, Decompiler = decompilerService.Decompiler, TreeViewNodeTextElementProvider = treeViewNodeTextElementProvider, DocumentService = documentTabService.DocumentTreeView.DocumentService, ShowToken = analyzerSettings.ShowToken, SingleClickExpandsChildren = analyzerSettings.SingleClickExpandsChildren, SyntaxHighlight = analyzerSettings.SyntaxHighlight, UseNewRenderer = analyzerSettings.UseNewRenderer, AnalyzerService = this, }; var options = new TreeViewOptions { CanDragAndDrop = false, TreeViewListener = this, }; TreeView = treeViewService.Create(ANALYZER_TREEVIEW_GUID, options); context.TreeView = TreeView; documentTabService.DocumentTreeView.DocumentService.CollectionChanged += DocumentService_CollectionChanged; documentTabService.DocumentModified += DocumentTabService_FileModified; decompilerService.DecompilerChanged += DecompilerService_DecompilerChanged; analyzerSettings.PropertyChanged += AnalyzerSettings_PropertyChanged; menuService.InitializeContextMenu(TreeView.UIObject, new Guid(MenuConstants.GUIDOBJ_ANALYZER_TREEVIEW_GUID), new GuidObjectsProvider(TreeView)); wpfCommandService.Add(ControlConstants.GUID_ANALYZER_TREEVIEW, TreeView.UIObject); var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_ANALYZER_TREEVIEW); var command = new RelayCommand(a => ActivateNode()); cmds.Add(command, ModifierKeys.Control, Key.Enter); cmds.Add(command, ModifierKeys.Shift, Key.Enter); }