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); }
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); }
DocumentViewerProvider(IWpfCommandService wpfCommandService, IMenuService menuService, IDocumentViewerServiceImpl documentViewerServiceImpl, ITextBufferFactoryService textBufferFactoryService, IDsTextEditorFactoryService dsTextEditorFactoryService) { this.wpfCommandService = wpfCommandService; this.menuService = menuService; this.documentViewerServiceImpl = documentViewerServiceImpl; this.textBufferFactoryService = textBufferFactoryService; this.dsTextEditorFactoryService = dsTextEditorFactoryService; }
CommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, DeleteResourceCommand.EditMenuCommand removeCmd1, DeleteResourceElementCommand.EditMenuCommand removeCmd2, DeleteResourceCommand.CodeCommand removeCmd3, DeleteResourceElementCommand.CodeCommand removeCmd4, ResourceSettingsCommand.EditMenuCommand settingsCmd10, ResourceSettingsCommand.CodeCommand settingsCmd11, ResourceElementSettingsCommand.EditMenuCommand settingsCmd20, ResourceElementSettingsCommand.CodeCommand settingsCmd21, ImageResourceElementSettingsCommand.EditMenuCommand settingsCmd30, ImageResourceElementSettingsCommand.CodeCommand settingsCmd31, SerializedImageResourceElementSettingsCommand.EditMenuCommand settingsCmd40, SerializedImageResourceElementSettingsCommand.CodeCommand settingsCmd41, SerializedImageListStreamerResourceElementSettingsCommand.EditMenuCommand settingsCmd50, SerializedImageListStreamerResourceElementSettingsCommand.CodeCommand settingsCmd51) { wpfCommandService.AddRemoveCommand(removeCmd1); wpfCommandService.AddRemoveCommand(removeCmd2); wpfCommandService.AddRemoveCommand(removeCmd3, documentTabService); wpfCommandService.AddRemoveCommand(removeCmd4, documentTabService); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd10, settingsCmd11); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd20, settingsCmd21); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd30, settingsCmd31); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd40, settingsCmd41); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd50, settingsCmd51); }
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); } }
WatchContentFactoryImpl(IWpfCommandService wpfCommandService, Lazy <VariablesWindowVMFactory> variablesWindowVMFactory, Lazy <WatchVariablesWindowValueNodesProviderService> watchVariablesWindowValueNodesProviderService) { contents = new WatchContent[WatchWindowsHelper.NUMBER_OF_WATCH_WINDOWS]; this.wpfCommandService = wpfCommandService; this.variablesWindowVMFactory = variablesWindowVMFactory; this.watchVariablesWindowValueNodesProviderService = watchVariablesWindowValueNodesProviderService; }
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); }
ExceptionsContent(IWpfCommandService wpfCommandService, Lazy<IExceptionsVM> exceptionsVM) { exceptionsControl = new ExceptionsControl(); vmExceptions = exceptionsVM; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL, exceptionsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW, exceptionsControl.ListBox); }
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); }
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); }
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); }
public DocumentViewer(IWpfCommandService wpfCommandService, IDocumentViewerServiceImpl documentViewerServiceImpl, IMenuService menuService, DocumentViewerControl documentViewerControl) { if (wpfCommandService == null) { throw new ArgumentNullException(nameof(wpfCommandService)); } if (documentViewerServiceImpl == null) { throw new ArgumentNullException(nameof(documentViewerServiceImpl)); } if (menuService == null) { throw new ArgumentNullException(nameof(menuService)); } if (documentViewerControl == null) { throw new ArgumentNullException(nameof(documentViewerControl)); } this.wpfCommandService = wpfCommandService; this.documentViewerServiceImpl = documentViewerServiceImpl; this.documentViewerControl = documentViewerControl; menuService.InitializeContextMenu(documentViewerControl.TextView.VisualElement, MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID, new GuidObjectsProvider(this), new ContextMenuInitializer(documentViewerControl.TextView)); // Prevent the tab control's context menu from popping up when right-clicking in the textview host margin menuService.InitializeContextMenu(documentViewerControl, Guid.NewGuid()); wpfCommandService.Add(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT, documentViewerControl); documentViewerControl.TextView.Properties.AddProperty(typeof(DocumentViewer), this); documentViewerControl.TextView.TextBuffer.Properties.AddProperty(DocumentViewerExtensions.DocumentViewerTextBufferKey, this); }
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); }
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); }
ExceptionsContent(IWpfCommandService wpfCommandService, Lazy <IExceptionsVM> exceptionsVM) { exceptionsControl = new ExceptionsControl(); vmExceptions = exceptionsVM; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL, exceptionsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW, exceptionsControl.ListBox); }
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); }
LocalsContent(IWpfCommandService wpfCommandService, ILocalsVM localsVM) { localsControl = new LocalsControl(); vmLocals = localsVM; localsControl.DataContext = vmLocals; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_LOCALS_CONTROL, localsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_LOCALS_LISTVIEW, localsControl.ListView); }
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, 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); }
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); }
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); }
LocalsContent(IWpfCommandService wpfCommandService, ILocalsVM localsVM) { this.localsControl = new LocalsControl(); this.vmLocals = localsVM; this.localsControl.DataContext = this.vmLocals; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_LOCALS_CONTROL, localsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_LOCALS_LISTVIEW, localsControl.ListView); }
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); }
ExceptionsContent(IWpfCommandService wpfCommandService, IThemeService themeService, Lazy <IExceptionsVM> exceptionsVM) { this.exceptionsControl = new ExceptionsControl(); this.vmExceptions = exceptionsVM; themeService.ThemeChanged += ThemeService_ThemeChanged; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL, exceptionsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW, exceptionsControl.ListBox); }
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); }
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); }
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; }
MemoryToolWindowContentProvider(IWpfCommandService wpfCommandService, Lazy<HexEditorGroupFactoryService> hexEditorGroupFactoryService, Lazy<IMemoryVM> memoryVM) { this.wpfCommandService = wpfCommandService; this.hexEditorGroupFactoryService = hexEditorGroupFactoryService; this.memoryVM = memoryVM; contents = new TWContent[MemoryWindowsHelper.NUMBER_OF_MEMORY_WINDOWS]; for (int i = 0; i < contents.Length; i++) { var tmpIndex = i; contents[i] = new TWContent(i, () => CreateContent(tmpIndex)); } }
BreakpointsContent(IWpfCommandService wpfCommandService, Lazy<IBreakpointsVM> breakpointsVM, Lazy<IModuleLoader> moduleLoader, IDocumentTabService documentTabService, IModuleIdProvider moduleIdProvider) { breakpointsControl = new BreakpointsControl(); this.moduleLoader = moduleLoader; this.documentTabService = documentTabService; vmBreakpoints = breakpointsVM; this.moduleIdProvider = moduleIdProvider; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_BREAKPOINTS_CONTROL, breakpointsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_BREAKPOINTS_LISTVIEW, breakpointsControl.ListView); }
ProcessesContent(IWpfCommandService wpfCommandService, IProcessesVM processesVM, ProcessesOperations processesOperations, IMessageBoxService messageBoxService) { Operations = processesOperations; processesControl = new ProcessesControl(); this.processesVM = processesVM; processesControl.DataContext = new ControlVM(processesVM, processesOperations, messageBoxService, processesControl); processesControl.ProcessesListViewDoubleClick += ProcessesControl_ProcessesListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_PROCESSES_CONTROL, processesControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_PROCESSES_LISTVIEW, processesControl.ListView); }
CallStackContent(IWpfCommandService wpfCommandService, ICallStackVM callStackVM, CallStackOperations callStackOperations) { Operations = callStackOperations; callStackControl = new CallStackControl(); this.callStackVM = callStackVM; callStackControl.DataContext = new ControlVM(callStackVM, callStackOperations); callStackControl.CallStackListViewDoubleClick += CallStackControl_CallStackListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_CONTROL, callStackControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_LISTVIEW, callStackControl.ListView); }
ThreadsContent(IWpfCommandService wpfCommandService, IThreadsVM threadsVM, ThreadsOperations threadsOperations, IMessageBoxService messageBoxService) { Operations = threadsOperations; threadsControl = new ThreadsControl(); this.threadsVM = threadsVM; threadsControl.DataContext = new ControlVM(threadsVM, threadsOperations, messageBoxService, threadsControl); threadsControl.ThreadsListViewDoubleClick += ThreadsControl_ThreadsListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_THREADS_CONTROL, threadsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_THREADS_LISTVIEW, threadsControl.ListView); }
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); }
ModulesContent(IWpfCommandService wpfCommandService, IModulesVM modulesVM, ModulesOperations modulesOperations, IMessageBoxService messageBoxService) { Operations = modulesOperations; modulesControl = new ModulesControl(); this.modulesVM = modulesVM; modulesControl.DataContext = new ControlVM(modulesVM, modulesOperations, messageBoxService, modulesControl); modulesControl.ModulesListViewDoubleClick += ModulesControl_ModulesListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_CONTROL, modulesControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_LISTVIEW, modulesControl.ListView); }
BreakpointsContent(IWpfCommandService wpfCommandService, Lazy <IBreakpointsVM> breakpointsVM, Lazy <IModuleLoader> moduleLoader, IDocumentTabService documentTabService, IModuleIdProvider moduleIdProvider) { breakpointsControl = new BreakpointsControl(); this.moduleLoader = moduleLoader; this.documentTabService = documentTabService; vmBreakpoints = breakpointsVM; this.moduleIdProvider = moduleIdProvider; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_BREAKPOINTS_CONTROL, breakpointsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_BREAKPOINTS_LISTVIEW, breakpointsControl.ListView); }
ModulesContent(IWpfCommandService wpfCommandService, IModulesVM modulesVM, IDocumentTabService documentTabService, Lazy<IModuleLoader> moduleLoader, Lazy<IInMemoryModuleService> inMemoryModuleService) { modulesControl = new ModulesControl(); vmModules = modulesVM; this.documentTabService = documentTabService; this.moduleLoader = moduleLoader; this.inMemoryModuleService = inMemoryModuleService; modulesControl.DataContext = vmModules; modulesControl.ModulesListViewDoubleClick += ModulesControl_ModulesListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_CONTROL, modulesControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_LISTVIEW, modulesControl.ListView); }
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); }
public MemoryContent(IWpfCommandService wpfCommandService, IMemoryVM memoryVM, HexEditorGroupFactoryService hexEditorGroupFactoryService) { vmMemory = memoryVM; memoryVM.UnderlyingStreamChanged += MemoryVM_UnderlyingStreamChanged; hexViewHost = hexEditorGroupFactoryService.Create(memoryVM.Buffer, PredefinedHexViewRoles.HexEditorGroup, PredefinedHexViewRoles.HexEditorGroupDebuggerMemory, new Guid(MenuConstants.GUIDOBJ_DEBUGGER_MEMORY_HEXVIEW_GUID)); memoryControl = new MemoryControl(hexViewHost.HostControl); memoryControl.DataContext = vmMemory; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_WPFHEXVIEWHOST, hexViewHost.HostControl); }
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); } }
CallStackContent(IWpfCommandService wpfCommandService, ICallStackVM callStackVM, Lazy<IStackFrameService> stackFrameService, IDocumentTabService documentTabService, Lazy<IModuleLoader> moduleLoader, IModuleIdProvider moduleIdProvider) { callStackControl = new CallStackControl(); vmCallStack = callStackVM; this.stackFrameService = stackFrameService; this.documentTabService = documentTabService; this.moduleLoader = moduleLoader; this.moduleIdProvider = moduleIdProvider; callStackControl.DataContext = vmCallStack; callStackControl.CallStackListViewDoubleClick += CallStackControl_CallStackListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_CONTROL, callStackControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_LISTVIEW, callStackControl.ListView); }
ThreadsContent(IWpfCommandService wpfCommandService, IThreadsVM threadsVM, Lazy<IStackFrameService> stackFrameService, IDocumentTabService documentTabService, Lazy<IModuleLoader> moduleLoader, IModuleIdProvider moduleIdProvider) { this.stackFrameService = stackFrameService; this.documentTabService = documentTabService; this.moduleLoader = moduleLoader; threadsControl = new ThreadsControl(); vmThreads = threadsVM; this.moduleIdProvider = moduleIdProvider; threadsControl.DataContext = vmThreads; threadsControl.ThreadsListViewDoubleClick += ThreadsControl_ThreadsListViewDoubleClick; wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_THREADS_CONTROL, threadsControl); wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_THREADS_LISTVIEW, threadsControl.ListView); }
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); }
DocumentTreeViewProvider(ITreeViewService treeViewService, IDecompilerService decompilerService, IDsDocumentServiceProvider documentServiceProvider, IDocumentTreeViewSettings documentTreeViewSettings, IMenuService menuService, IDotNetImageService dotNetImageService, IWpfCommandService wpfCommandService, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable<Lazy<IDsDocumentNodeProvider, IDsDocumentNodeProviderMetadata>> dsDocumentNodeProviders, [ImportMany] IEnumerable<Lazy<IDocumentTreeNodeDataFinder, IDocumentTreeNodeDataFinderMetadata>> mefFinders, ITreeViewNodeTextElementProvider treeViewNodeTextElementProvider) { this.treeViewService = treeViewService; this.decompilerService = decompilerService; this.documentServiceProvider = documentServiceProvider; this.documentTreeViewSettings = documentTreeViewSettings; this.menuService = menuService; this.dotNetImageService = dotNetImageService; this.wpfCommandService = wpfCommandService; this.resourceNodeFactory = resourceNodeFactory; this.appSettings = appSettings; this.dsDocumentNodeProviders = dsDocumentNodeProviders.ToArray(); this.mefFinders = mefFinders.ToArray(); this.treeViewNodeTextElementProvider = treeViewNodeTextElementProvider; }
public DocumentViewer(IWpfCommandService wpfCommandService, IDocumentViewerServiceImpl documentViewerServiceImpl, IMenuService menuService, DocumentViewerControl documentViewerControl) { if (wpfCommandService == null) throw new ArgumentNullException(nameof(wpfCommandService)); if (documentViewerServiceImpl == null) throw new ArgumentNullException(nameof(documentViewerServiceImpl)); if (menuService == null) throw new ArgumentNullException(nameof(menuService)); if (documentViewerControl == null) throw new ArgumentNullException(nameof(documentViewerControl)); this.wpfCommandService = wpfCommandService; this.documentViewerServiceImpl = documentViewerServiceImpl; this.documentViewerControl = documentViewerControl; menuService.InitializeContextMenu(documentViewerControl.TextView.VisualElement, MenuConstants.GUIDOBJ_DOCUMENTVIEWERCONTROL_GUID, new GuidObjectsProvider(this), new ContextMenuInitializer(documentViewerControl.TextView)); // Prevent the tab control's context menu from popping up when right-clicking in the textview host margin menuService.InitializeContextMenu(documentViewerControl, Guid.NewGuid()); wpfCommandService.Add(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT, documentViewerControl); documentViewerControl.TextView.Properties.AddProperty(typeof(DocumentViewer), this); documentViewerControl.TextView.TextBuffer.Properties.AddProperty(DocumentViewerExtensions.DocumentViewerTextBufferKey, this); }
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); }
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); }
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); }
CommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, RemoveAssemblyCommand.EditMenuCommand removeCmd, AssemblySettingsCommand.EditMenuCommand settingsCmd) { wpfCommandService.AddRemoveCommand(removeCmd); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd, null); }
CommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, DeleteEventDefCommand.EditMenuCommand removeCmd, DeleteEventDefCommand.CodeCommand removeCmd2, EventDefSettingsCommand.EditMenuCommand settingsCmd, EventDefSettingsCommand.CodeCommand settingsCmd2) { wpfCommandService.AddRemoveCommand(removeCmd); wpfCommandService.AddRemoveCommand(removeCmd2, documentTabService); wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd, settingsCmd2); }
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>(); }
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)); }