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);
		}
Exemple #2
0
        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);
        }
Exemple #3
0
		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);
		}
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        ModuleBreakpointsContent(IWpfCommandService wpfCommandService, IModuleBreakpointsVM moduleBreakpointsVM, ModuleBreakpointsOperations moduleBreakpointsOperations, IMessageBoxService messageBoxService)
        {
            Operations = moduleBreakpointsOperations;
            moduleBreakpointsControl             = new ModuleBreakpointsControl();
            this.moduleBreakpointsVM             = moduleBreakpointsVM;
            moduleBreakpointsControl.DataContext = new ControlVM(moduleBreakpointsVM, moduleBreakpointsOperations, messageBoxService, moduleBreakpointsControl);

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULEBREAKPOINTS_CONTROL, moduleBreakpointsControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULEBREAKPOINTS_LISTVIEW, moduleBreakpointsControl.ListView);

            moduleBreakpointsControl.ListView.PreviewKeyDown += ListView_PreviewKeyDown;
        }
Exemple #12
0
        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);
        }
Exemple #13
0
		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);
		}
Exemple #14
0
        public MemoryContent(IWpfCommandService wpfCommandService, IMemoryVM memoryVM, ProcessHexBufferProvider processHexBufferProvider, HexEditorGroupFactoryService hexEditorGroupFactoryService)
        {
            this.memoryVM = memoryVM;
            hexBufferInfo = processHexBufferProvider.CreateBuffer();
            hexBufferInfo.UnderlyingStreamChanged += HexBufferInfo_UnderlyingStreamChanged;

            hexViewHost               = hexEditorGroupFactoryService.Create(hexBufferInfo.Buffer, PredefinedHexViewRoles.HexEditorGroup, PredefinedHexViewRoles.HexEditorGroupDebuggerMemory, new Guid(MenuConstants.GUIDOBJ_DEBUGGER_MEMORY_HEXVIEW_GUID));
            memoryControl             = new MemoryControl(hexViewHost.HostControl);
            memoryControl.DataContext = memoryVM;

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_WPFHEXVIEWHOST, hexViewHost.HostControl);
        }
Exemple #15
0
        ModulesContent(IWpfCommandService wpfCommandService, IModulesVM modulesVM, IDocumentTabService documentTabService, Lazy <IModuleLoader> moduleLoader, Lazy <IInMemoryModuleService> inMemoryModuleService)
        {
            this.modulesControl             = new ModulesControl();
            this.vmModules                  = modulesVM;
            this.documentTabService         = documentTabService;
            this.moduleLoader               = moduleLoader;
            this.inMemoryModuleService      = inMemoryModuleService;
            this.modulesControl.DataContext = this.vmModules;
            this.modulesControl.ModulesListViewDoubleClick += ModulesControl_ModulesListViewDoubleClick;

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_CONTROL, modulesControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MODULES_LISTVIEW, modulesControl.ListView);
        }
Exemple #16
0
		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);
		}
Exemple #17
0
        CodeBreakpointsContent(IWpfCommandService wpfCommandService, ICodeBreakpointsVM codeBreakpointsVM, CodeBreakpointsOperations codeBreakpointsOperations, IMessageBoxService messageBoxService)
        {
            Operations                         = codeBreakpointsOperations;
            codeBreakpointsControl             = new CodeBreakpointsControl();
            this.codeBreakpointsVM             = codeBreakpointsVM;
            codeBreakpointsControl.DataContext = new ControlVM(codeBreakpointsVM, codeBreakpointsOperations, messageBoxService, codeBreakpointsControl);
            codeBreakpointsControl.CodeBreakpointsListViewDoubleClick += CodeBreakpointsControl_CodeBreakpointsListViewDoubleClick;

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CODEBREAKPOINTS_CONTROL, codeBreakpointsControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CODEBREAKPOINTS_LISTVIEW, codeBreakpointsControl.ListView);

            codeBreakpointsControl.ListView.PreviewKeyDown += ListView_PreviewKeyDown;
        }
Exemple #18
0
        BookmarksContent(IWpfCommandService wpfCommandService, IBookmarksVM bookmarksVM, BookmarksOperations bookmarksOperations, IMessageBoxService messageBoxService)
        {
            Operations                   = bookmarksOperations;
            bookmarksControl             = new BookmarksControl();
            this.bookmarksVM             = bookmarksVM;
            bookmarksControl.DataContext = new ControlVM(bookmarksVM, bookmarksOperations, messageBoxService, bookmarksControl);
            bookmarksControl.BookmarksListViewDoubleClick += BookmarksControl_BookmarksListViewDoubleClick;

            wpfCommandService.Add(ControlConstants.GUID_BOOKMARKS_CONTROL, bookmarksControl);
            wpfCommandService.Add(ControlConstants.GUID_BOOKMARKS_LISTVIEW, bookmarksControl.ListView);

            bookmarksControl.ListView.PreviewKeyDown += ListView_PreviewKeyDown;
        }
Exemple #19
0
		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);
		}
Exemple #20
0
        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);
        }
        CallStackContent(IWpfCommandService wpfCommandService, ICallStackVM callStackVM, Lazy <IStackFrameService> stackFrameService, IDocumentTabService documentTabService, Lazy <IModuleLoader> moduleLoader, IModuleIdProvider moduleIdProvider)
        {
            this.callStackControl             = new CallStackControl();
            this.vmCallStack                  = callStackVM;
            this.stackFrameService            = stackFrameService;
            this.documentTabService           = documentTabService;
            this.moduleLoader                 = moduleLoader;
            this.moduleIdProvider             = moduleIdProvider;
            this.callStackControl.DataContext = this.vmCallStack;
            this.callStackControl.CallStackListViewDoubleClick += CallStackControl_CallStackListViewDoubleClick;

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_CONTROL, callStackControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_CALLSTACK_LISTVIEW, callStackControl.ListView);
        }
Exemple #22
0
 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);
 }
        ExceptionsContent(IWpfCommandService wpfCommandService, IExceptionsVM exceptionsVM, ExceptionsOperations exceptionsOperations, Lazy <DbgExceptionSettingsService> dbgExceptionSettingsService, IMessageBoxService messageBoxService)
        {
            Operations        = exceptionsOperations;
            exceptionsControl = new ExceptionsControl();
            var addVM = new AddExceptionVM(dbgExceptionSettingsService);

            exceptionsControl.addExceptionControl.DataContext       = addVM;
            exceptionsControl.addExceptionControl.IsVisibleChanged += AddExceptionControl_IsVisibleChanged;
            exceptionsControl.addExceptionControl.InputBindings.Add(new KeyBinding(addVM.SaveCommand, Key.Enter, ModifierKeys.None));
            exceptionsControl.addExceptionControl.InputBindings.Add(new KeyBinding(new RelayCommand(a => exceptionsVM.IsAddingExceptions = false), Key.Escape, ModifierKeys.None));
            this.exceptionsVM             = exceptionsVM;
            exceptionsControl.DataContext = new ControlVM(exceptionsVM, exceptionsOperations, messageBoxService, exceptionsControl);
            exceptionsControl.ExceptionsListViewDoubleClick += ExceptionsControl_ExceptionsListViewDoubleClick;

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL, exceptionsControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW, exceptionsControl.ListView);
        }
Exemple #24
0
        SearchService(IDecompilerService decompilerService, ISearchSettings searchSettings, IDocumentSearcherProvider fileSearcherProvider, IMenuService menuService, IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, IClassificationFormatMapService classificationFormatMapService)
        {
            var classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.Search);

            this.documentTabService = documentTabService;
            this.searchControl      = new SearchControl();
            this.vmSearch           = new SearchControlVM(fileSearcherProvider, documentTabService.DocumentTreeView, searchSettings)
            {
                Decompiler = decompilerService.Decompiler,
            };
            this.searchControl.DataContext = this.vmSearch;

            menuService.InitializeContextMenu(this.searchControl.ListBox, MenuConstants.GUIDOBJ_SEARCH_GUID, new GuidObjectsProvider());
            wpfCommandService.Add(ControlConstants.GUID_SEARCH_CONTROL, this.searchControl);
            wpfCommandService.Add(ControlConstants.GUID_SEARCH_LISTBOX, this.searchControl.ListBox);
            decompilerService.DecompilerChanged += DecompilerService_DecompilerChanged;
            classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged;
            searchSettings.PropertyChanged += SearchSettings_PropertyChanged;
            documentTabService.DocumentTreeView.DocumentService.CollectionChanged += DocumentService_CollectionChanged;

            this.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);
        }
Exemple #25
0
        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();
        }
Exemple #26
0
        public MemoryContent(IWpfCommandService wpfCommandService, IMenuService menuService, IHexEditorSettings hexEditorSettings, IMemoryVM memoryVM, IAppSettings appSettings)
        {
            this.memoryControl = new MemoryControl();
            this.vmMemory      = memoryVM;
            this.vmMemory.SetRefreshLines(() => this.memoryControl.DnHexBox.RedrawModifiedLines());
            this.memoryControl.DataContext = this.vmMemory;
            var dnHexBox = new DnHexBox(menuService, hexEditorSettings)
            {
                CacheLineBytes = true,
                IsMemory       = true,
            };

            dnHexBox.SetBinding(HexBox.DocumentProperty, nameof(vmMemory.HexDocument));
            this.memoryControl.DnHexBox = dnHexBox;
            dnHexBox.StartOffset        = 0;
            dnHexBox.EndOffset          = IntPtr.Size == 4 ? uint.MaxValue : ulong.MaxValue;

            appSettings.PropertyChanged += AppSettings_PropertyChanged;
            UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);

            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl);
            wpfCommandService.Add(ControlConstants.GUID_DEBUGGER_MEMORY_HEXBOX, memoryControl.DnHexBox);
        }
Exemple #27
0
        public Window InitializeMainWindow()
        {
            var sc = new StackedContent <IStackedContentChild>(false);

            sc.AddChild(appToolBar, StackedContentChildInfo.CreateVertical(new GridLength(0, GridUnitType.Auto)));
            sc.AddChild(stackedContent, StackedContentChildInfo.CreateVertical(new GridLength(1, GridUnitType.Star)));
            sc.AddChild(statusBar, StackedContentChildInfo.CreateVertical(new GridLength(0, GridUnitType.Auto)));
            mainWindow = new MainWindow(sc.UIObject);
            AddTitleInfo(IntPtr.Size == 4 ? "x86" : "x64");
            wpfCommandService.Add(ControlConstants.GUID_MAINWINDOW, mainWindow);
            new SavedWindowStateRestorer(mainWindow, uiSettings.SavedWindowState, DefaultWindowLocation);
            mainWindow.Closing          += MainWindow_Closing;
            mainWindow.Closed           += MainWindow_Closed;
            mainWindow.GotKeyboardFocus += MainWindow_GotKeyboardFocus;
            RefreshToolBar();
            return(mainWindow);
        }
Exemple #28
0
        OutputContent(IWpfCommandService wpfCommandService, Lazy <IOutputServiceInternal> outputVM)
        {
            outputControl = new OutputControl();
            vmOutput      = outputVM;

            wpfCommandService.Add(ControlConstants.GUID_OUTPUT_CONTROL, outputControl);
            var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_OUTPUT_CONTROL);

            cmds.Add(ApplicationCommands.Save,
                     (s, e) => OutputService.SaveText(),
                     (s, e) => e.CanExecute = OutputService.CanSaveText);
            cmds.Add(OutputCommands.CopyCommand,
                     (s, e) => OutputService.Copy(),
                     (s, e) => e.CanExecute = OutputService.CanCopy);
            cmds.Add(OutputCommands.CopyCommand, ModifierKeys.Control, Key.C);
            cmds.Add(OutputCommands.CopyCommand, ModifierKeys.Control, Key.Insert);
            cmds.Add(OutputCommands.ClearAllCommand,
                     (s, e) => OutputService.ClearAll(),
                     (s, e) => e.CanExecute = OutputService.CanClearAll);
            cmds.Add(OutputCommands.ClearAllCommand, ModifierKeys.Control, Key.L);
            cmds.Add(OutputCommands.ToggleWordWrapCommand,
                     (s, e) => OutputService.WordWrap = !OutputService.WordWrap,
                     (s, e) => e.CanExecute           = true);
            cmds.Add(OutputCommands.ToggleShowLineNumbersCommand,
                     (s, e) => OutputService.ShowLineNumbers = !OutputService.ShowLineNumbers,
                     (s, e) => e.CanExecute = true);
            cmds.Add(OutputCommands.ToggleShowTimestampsCommand,
                     (s, e) => OutputService.ShowTimestamps = !OutputService.ShowTimestamps,
                     (s, e) => e.CanExecute = true);
            for (int i = 0; i < OutputCommands.SelectLogWindowCommands.Length; i++)
            {
                int tmpIndex = i;
                cmds.Add(OutputCommands.SelectLogWindowCommands[i],
                         (s, e) => SelectLog(tmpIndex),
                         (s, e) => e.CanExecute = OutputService.CanSelectLog(tmpIndex));
            }

            outputControl.PreviewKeyDown += OutputControl_PreviewKeyDown;
        }
Exemple #29
0
        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);
        }
		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);
		}
Exemple #31
0
		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);
		}
Exemple #32
0
		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);
		}
Exemple #33
0
		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);
		}