Exemplo n.º 1
0
		SaveModuleCommand(IDocumentTabService documentTabService, Lazy<IUndoCommandService> undoCommandService, Lazy<IHexBufferService> hexBufferService, Lazy<IDocumentSaver> documentSaver)
			: base(documentTabService.DocumentTreeView) {
			this.documentTabService = documentTabService;
			this.undoCommandService = undoCommandService;
			this.hexBufferService = hexBufferService;
			this.documentSaver = documentSaver;
		}
		public DocumentTabReferenceResult Create(IDocumentTabService documentTabService, DocumentTabContent sourceContent, object @ref) {
			var textRef = @ref as TextReference;
			if (textRef != null)
				@ref = textRef.Reference;
			var node = @ref as DocumentTreeNodeData;
			if (node != null)
				return Create(node);
			var nsRef = @ref as NamespaceRef;
			if (nsRef != null)
				return Create(nsRef);
			var nsRef2 = @ref as NamespaceReference;
			if (nsRef2 != null)
				return Create(nsRef2);
			var document = @ref as IDsDocument;
			if (document != null)
				return Create(document);
			var asm = @ref as AssemblyDef;
			if (asm != null)
				return Create(asm);
			var mod = @ref as ModuleDef;
			if (mod != null)
				return Create(mod);
			var asmRef = @ref as IAssembly;
			if (asmRef != null) {
				document = documentTreeView.DocumentService.Resolve(asmRef, null);
				if (document != null)
					return Create(document);
			}
			return null;
		}
Exemplo n.º 3
0
		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);
		}
Exemplo n.º 4
0
		public static bool GoToIL(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IDsDocument document, uint token, uint ilOffset, bool newTab) {
			if (document == null)
				return false;

			var method = document.ModuleDef.ResolveToken(token) as MethodDef;
			if (method == null)
				return false;

			var modId = moduleIdProvider.Create(method.Module);
			var key = new ModuleTokenId(modId, method.MDToken);

			bool found = documentTabService.DocumentTreeView.FindNode(method.Module) != null;
			if (found) {
				documentTabService.FollowReference(method, newTab, true, e => {
					Debug.Assert(e.Tab.UIContext is IDocumentViewer);
					if (e.Success && !e.HasMovedCaret) {
						MoveCaretTo(e.Tab.UIContext as IDocumentViewer, key, ilOffset);
						e.HasMovedCaret = true;
					}
				});
				return true;
			}

			Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => {
				documentTabService.FollowReference(method, newTab, true, e => {
					Debug.Assert(e.Tab.UIContext is IDocumentViewer);
					if (e.Success && !e.HasMovedCaret) {
						MoveCaretTo(e.Tab.UIContext as IDocumentViewer, key, ilOffset);
						e.HasMovedCaret = true;
					}
				});
			}));
			return true;
		}
Exemplo n.º 5
0
		AboutScreenMenuItem(IDocumentViewerContentFactoryProvider documentViewerContentFactoryProvider, IDocumentTabService documentTabService, IAppWindow appWindow, IExtensionService extensionService, IContentTypeRegistryService contentTypeRegistryService) {
			this.documentViewerContentFactoryProvider = documentViewerContentFactoryProvider;
			this.documentTabService = documentTabService;
			this.appWindow = appWindow;
			this.extensionService = extensionService;
			aboutContentType = contentTypeRegistryService.GetContentType(ContentTypes.AboutDnSpy);
		}
Exemplo n.º 6
0
		NavigationCommandInstaller(IDocumentTabService documentTabService, IAppWindow appWindow) {
			this.documentTabService = documentTabService;
			Debug.Assert(Application.Current != null && Application.Current.MainWindow != null);
			var cmds = appWindow.MainWindowCommands;
			cmds.Add(NavigationCommands.BrowseBack, new RelayCommand(a => BrowseBack(), a => CanBrowseBack));
			cmds.Add(NavigationCommands.BrowseForward, new RelayCommand(a => BrowseForward(), a => CanBrowseForward));
		}
Exemplo n.º 7
0
		public static bool GoTo(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
			if (GoToIL(moduleIdProvider, documentTabService, moduleLoader, frame, newTab))
				return true;

			//TODO: eg. native frame or internal frame

			return false;
		}
		public DocumentTabReferenceResult Create(IDocumentTabService documentTabService, DocumentTabContent sourceContent, object @ref) {
			var tokRef = @ref as TokenReference;
			if (tokRef == null)
				tokRef = (@ref as TextReference)?.Reference as TokenReference;
			if (tokRef != null)
				return Create(tokRef, documentTabService);
			return null;
		}
		public DocumentTabReferenceResult Create(IDocumentTabService documentTabService, DocumentTabContent sourceContent, object @ref) {
			var addrRef = @ref as AddressReference;
			if (addrRef == null)
				addrRef = (@ref as TextReference)?.Reference as AddressReference;
			if (addrRef != null)
				return Create(addrRef, documentTabService.DocumentTreeView);
			return null;
		}
		DocumentTabReferenceResult Create(TokenReference tokRef, IDocumentTabService documentTabService) {
			var node = HexDocumentTreeNodeDataFinder.FindNode(documentTabService.DocumentTreeView, tokRef);
			if (node == null)
				return null;
			var content = documentTabService.TryCreateContent(new DocumentTreeNodeData[] { node });
			if (content == null)
				return null;
			return new DocumentTabReferenceResult(content);
		}
Exemplo n.º 11
0
		public TreeViewUpdater(IDocumentTabService documentTabService, CorModuleDefFile cmdf, ModuleDocumentNode node, HashSet<uint> modifiedTypes, HashSet<uint> loadedClassTokens) {
			Debug.Assert(node.Document == cmdf);
			this.documentTabService = documentTabService;
			CorModuleDefFile = cmdf;
			ModuleNode = node;
			this.modifiedTypes = new HashSet<uint>(modifiedTypes);
			this.loadedClassTokens = loadedClassTokens;
			checkedTypes = new HashSet<TypeDef>();
			modNode = node;
		}
Exemplo n.º 12
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);
		}
Exemplo n.º 13
0
		InMemoryModuleService(ITheDebugger theDebugger, IDocumentTabService documentTabService, Lazy<IMethodAnnotations> methodAnnotations, IAppWindow appWindow, SimpleProcessReader simpleProcessReader) {
			this.documentTabService = documentTabService;
			documentTreeView = documentTabService.DocumentTreeView;
			documentService = documentTreeView.DocumentService;
			this.appWindow = appWindow;
			this.methodAnnotations = methodAnnotations;
			this.theDebugger = theDebugger;
			this.simpleProcessReader = simpleProcessReader;
			theDebugger.OnProcessStateChanged_First += TheDebugger_OnProcessStateChanged_First;
		}
Exemplo n.º 14
0
		public TabsVM(IDocumentTabService documentTabService, ISaveService saveService, ITabsVMSettings tabsVMSettings, IClassificationFormatMap classificationFormatMap, ITextElementProvider textElementProvider) {
			this.documentTabService = documentTabService;
			this.saveService = saveService;
			ClassificationFormatMap = classificationFormatMap;
			TextElementProvider = textElementProvider;
			Settings = tabsVMSettings;
			tabsList = new ObservableCollection<TabVM>(documentTabService.SortedTabs.Select(a => new TabVM(this, a)));
			SelectedItem = tabsList.Count == 0 ? null : tabsList[0];
			InitializeSaveText();
		}
Exemplo n.º 15
0
		public static bool GoToIL(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
			if (!CanGoToIL(frame))
				return false;

			var func = frame.Function;
			if (func == null)
				return false;

			return DebugUtils.GoToIL(moduleIdProvider, documentTabService, moduleLoader.LoadModule(func.Module, canLoadDynFile: true, isAutoLoaded: true), frame.Token, frame.GetILOffset(moduleLoader), newTab);
		}
Exemplo n.º 16
0
		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);
			}
		}
Exemplo n.º 17
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);
		}
Exemplo n.º 18
0
		internal static void ExecuteInternal(IDocumentTabService documentTabService) {
			IDocumentTab tab;
			var resolver = GetResolver(documentTabService, out tab);
			if (resolver == null)
				return;

			var member = AskForDef(dnSpy_Resources.GoToToken_Title, resolver);
			if (member == null)
				return;

			tab.FollowReference(member, false);
		}
Exemplo n.º 19
0
		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);
		}
Exemplo n.º 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);
		}
Exemplo n.º 21
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);
		}
Exemplo n.º 22
0
		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);
		}
		DsDocumentUndoableDocumentsProvider(IDocumentTabService documentTabService) {
			this.documentTabService = documentTabService;
		}
Exemplo n.º 24
0
 public IDocumentTabContent Create(IDocumentTabService documentTabService) =>
 documentTabContentFactoryService.CreateTabContent(Array.Empty <IDocumentTreeNodeData>());
		public DocumentTabReferenceResult Create(IDocumentTabService documentTabService, DocumentTabContent sourceContent, object @ref) {
			var textRef = @ref as TextReference;
			if (textRef != null) {
				if (textRef.Reference is IAssembly || textRef.Reference is ModuleDef || textRef.Reference is ModuleRef || textRef.Reference is NamespaceReference)
					return null;
				var result = CreateMemberRefResult(documentTabService, textRef.Reference);
				if (result != null)
					return result;

				return CreateLocalRefResult(sourceContent, textRef);
			}

			return CreateMemberRefResult(documentTabService, @ref);
		}
Exemplo n.º 26
0
 MoveAllToNextTabGroupCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 27
0
 protected CtxMenuTabGroupCommand(IDocumentTabService documentTabService) => this.documentTabService = documentTabService;
Exemplo n.º 28
0
 NewWindowCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 29
0
 OpenInNewTabCtxMenuCommand(IDocumentTabService documentTabService)
 {
     this.documentTabService = documentTabService;
 }
Exemplo n.º 30
0
 CloseAllTabsCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 31
0
 DocumentTreeViewCommand(IDocumentTabService documentTabService) => this.documentTabService = documentTabService;
Exemplo n.º 32
0
 TextEditorCommand(IDocumentTabService documentTabService) => this.documentTabService = documentTabService;
Exemplo n.º 33
0
 public ClassLoader(IDocumentTabService documentTabService, Window ownerWindow)
 {
     this.documentTabService = documentTabService;
     this.ownerWindow        = ownerWindow;
     loadedClasses           = new Dictionary <DnModule, HashSet <uint> >();
 }
Exemplo n.º 34
0
 CommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, DeleteFieldDefCommand.EditMenuCommand removeCmd, DeleteFieldDefCommand.CodeCommand removeCmd2, FieldDefSettingsCommand.EditMenuCommand settingsCmd, FieldDefSettingsCommand.CodeCommand settingsCmd2)
 {
     wpfCommandService.AddRemoveCommand(removeCmd);
     wpfCommandService.AddRemoveCommand(removeCmd2, documentTabService);
     wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd, settingsCmd2);
 }
Exemplo n.º 35
0
        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);
        }
Exemplo n.º 36
0
		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>();
		}
Exemplo n.º 37
0
 CommandLoader(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, RemoveNetModuleFromAssemblyCommand.EditMenuCommand removeCmd, ModuleSettingsCommand.EditMenuCommand settingsCmd)
 {
     wpfCommandService.AddRemoveCommand(removeCmd);
     wpfCommandService.AddSettingsCommand(documentTabService, settingsCmd, null);
 }
Exemplo n.º 38
0
 NewTabCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 39
0
 protected MenuTabGroupCommand(IDocumentTabService documentTabService)
 {
     this.documentTabService = documentTabService;
 }
Exemplo n.º 40
0
 CloseTabGroupCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 41
0
 MoveToPreviousTabGroupCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 42
0
 CloseAllTabGroupsButThisCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
 public SaveSourceMap(ISourceMapStorage map, IDocumentTabService tabService)
 {
     this.map        = map;
     this.tabService = tabService;
 }
Exemplo n.º 44
0
		public static void AddRemoveCommand(this IWpfCommandService wpfCommandService, CodeContextMenuHandler settingsCmd, IDocumentTabService documentTabService) {
			var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_DOCUMENTVIEWER_UICONTEXT);
			cmds.Add(EditingCommands.Delete, new CodeContextMenuHandlerCommandProxy(settingsCmd, documentTabService), ModifierKeys.None, Key.Delete);
		}
		DocumentTabReferenceResult CreateMemberRefResult(IDocumentTabService documentTabService, object @ref) {
			var resolvedRef = ResolveMemberDef(@ref);
			if (!IsSupportedReference(resolvedRef))
				return null;
			var newRef = GetReference(@ref);
			var node = documentTabService.DocumentTreeView.FindNode(newRef);
			if (node == null) {
				// If it's eg. a TypeDef, its assembly has been removed from the document list or it
				// was never inserted because adding an assembly had been temporarily disabled.
				// Add the assembly to the list again. Next time the user clicks on the link,
				// FindNode() above will succeed.
				var def = @ref as IMemberDef ?? (@ref as ParamDef)?.DeclaringMethod;
				if (def != null) {
					DsDocument document = null;
					var mod = def.Module;
					if (mod != null && mod.Assembly != null)
						document = DsDotNetDocument.CreateAssembly(DsDocumentInfo.CreateDocument(mod.Location), mod, false);
					else if (mod != null)
						document = DsDotNetDocument.CreateModule(DsDocumentInfo.CreateDocument(mod.Location), mod, false);
					if (document != null) {
						var existingDocument = documentTabService.DocumentTreeView.DocumentService.GetOrAdd(document);
						if (existingDocument != document)
							documentTabService.DocumentTreeView.DocumentService.ForceAdd(document, true, null);
					}
				}

				return null;
			}

			var content = decompileDocumentTabContentFactory.Create(new DocumentTreeNodeData[] { node });
			return new DocumentTabReferenceResult(content, null, a => {
				if (a.Success && !a.HasMovedCaret) {
					GoToReference(content, resolvedRef, content.WasNewContent);
					a.HasMovedCaret = true;
				}
			});
		}
Exemplo n.º 46
0
		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);
		}
Exemplo n.º 47
0
 MoveTabGroupAfterNextTabGroupCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 48
0
 DocumentSaver(Lazy <IUndoCommandService> undoCommandService, Lazy <IMmapDisabler> mmapDisabler, IDocumentTabService documentTabService, IAppWindow appWindow)
 {
     this.undoCommandService = undoCommandService;
     this.mmapDisabler       = mmapDisabler;
     this.documentTabService = documentTabService;
     this.appWindow          = appWindow;
 }
Exemplo n.º 49
0
 NewVerticalTabGroupCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 50
0
 internal static bool CanOpenNewTabInternal(IDocumentTabService documentTabService) => documentTabService.ActiveTab?.Content.CanClone == true;
Exemplo n.º 51
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);
		}
Exemplo n.º 52
0
 NewHorizontalTabGroupCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 53
0
		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);
		}
Exemplo n.º 54
0
 UseHorizontalTabGroupsCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 55
0
 MoveTabGroupBeforePreviousTabGroupCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 56
0
 DotNetReferenceNavigatorImpl(UIDispatcher uiDispatcher, IDocumentTabService documentTabService, Lazy <DbgMetadataService> dbgMetadataService)
 {
     this.uiDispatcher       = uiDispatcher;
     this.documentTabService = documentTabService;
     this.dbgMetadataService = dbgMetadataService;
 }
Exemplo n.º 57
0
 MergeAllTabGroupsCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 58
0
 UseVerticalTabGroupsCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 59
0
 MoveAllToPreviousTabGroupCtxMenuCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }
Exemplo n.º 60
0
 CloseTabCommand(IDocumentTabService documentTabService)
     : base(documentTabService)
 {
 }