/// <inheritdoc/> protected sealed override ImageReference GetIcon(IDotNetImageService dnImgMgr) { var imgRef = GetIcon(); if (!imgRef.IsDefault) return imgRef; var asm = dnImgMgr.GetType().Assembly; return ResourceUtilities.TryGetImageReference(asm, resourceElement.Name) ?? DsImages.Dialog; }
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 CodeToolTipProvider(IWpfTextView wpfTextView, IDotNetImageService dotNetImageService, IClassificationFormatMap classificationFormatMap, IThemeClassificationTypeService themeClassificationTypeService, bool syntaxHighlight) { if (wpfTextView == null) throw new ArgumentNullException(nameof(wpfTextView)); if (dotNetImageService == null) throw new ArgumentNullException(nameof(dotNetImageService)); if (classificationFormatMap == null) throw new ArgumentNullException(nameof(classificationFormatMap)); if (themeClassificationTypeService == null) throw new ArgumentNullException(nameof(themeClassificationTypeService)); this.wpfTextView = wpfTextView; this.dotNetImageService = dotNetImageService; this.classificationFormatMap = classificationFormatMap; this.themeClassificationTypeService = themeClassificationTypeService; this.syntaxHighlight = syntaxHighlight; writers = new List<CodeToolTipWriter>(); CreateNewOutput(); }
public ToolTipProviderContext(IDotNetImageService dotNetImageService, IDecompiler decompiler, ICodeToolTipSettings codeToolTipSettings, IDocumentViewer documentViewer, IClassificationFormatMap classificationFormatMap, IThemeClassificationTypeService themeClassificationTypeService) { if (dotNetImageService == null) throw new ArgumentNullException(nameof(dotNetImageService)); if (decompiler == null) throw new ArgumentNullException(nameof(decompiler)); if (codeToolTipSettings == null) throw new ArgumentNullException(nameof(codeToolTipSettings)); if (documentViewer == null) throw new ArgumentNullException(nameof(documentViewer)); if (classificationFormatMap == null) throw new ArgumentNullException(nameof(classificationFormatMap)); if (themeClassificationTypeService == null) throw new ArgumentNullException(nameof(themeClassificationTypeService)); DocumentViewer = documentViewer; this.dotNetImageService = dotNetImageService; Decompiler = decompiler; this.codeToolTipSettings = codeToolTipSettings; this.classificationFormatMap = classificationFormatMap; this.themeClassificationTypeService = themeClassificationTypeService; }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) { var td = TryGetTypeDef(); if (td != null) return dnImgMgr.GetImageReference(td); return isBaseType ? DsImages.ClassPublic : DsImages.InterfacePublic; }
protected override ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => DsImages.FolderOpened;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(analyzedProperty);
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(Document.ModuleDef);
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.TextFile;
/// <summary> /// Gets the icon /// </summary> /// <param name="dnImgMgr">Image service</param> /// <returns></returns> protected abstract ImageReference GetIcon(IDotNetImageService dnImgMgr);
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReferenceModuleRef();
AnalyzerService(IWpfCommandService wpfCommandService, IDocumentTabService documentTabService, ITreeViewService treeViewService, IMenuService menuService, IAnalyzerSettings analyzerSettings, IDotNetImageService dotNetImageService, IDecompilerService decompilerService, ITreeViewNodeTextElementProvider treeViewNodeTextElementProvider) { this.documentTabService = documentTabService; this.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, }; this.TreeView = treeViewService.Create(ANALYZER_TREEVIEW_GUID, options); this.context.TreeView = this.TreeView; documentTabService.DocumentTreeView.DocumentService.CollectionChanged += DocumentService_CollectionChanged; documentTabService.DocumentModified += DocumentTabService_FileModified; decompilerService.DecompilerChanged += DecompilerService_DecompilerChanged; analyzerSettings.PropertyChanged += AnalyzerSettings_PropertyChanged; menuService.InitializeContextMenu(this.TreeView.UIObject, new Guid(MenuConstants.GUIDOBJ_ANALYZER_TREEVIEW_GUID), new GuidObjectsProvider(this.TreeView)); wpfCommandService.Add(ControlConstants.GUID_ANALYZER_TREEVIEW, this.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); }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(analyzedProperty);
protected sealed override ImageReference GetIcon(IDotNetImageService dnImgMgr) => IconReference;
/// <inheritdoc/> protected sealed override ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
DocumentSearcherProvider(IDotNetImageService dotNetImageService, IDecompilerService decompilerService, ITextElementProvider textElementProvider, IClassificationFormatMapService classificationFormatMapService) { this.dotNetImageService = dotNetImageService; this.decompilerService = decompilerService; this.textElementProvider = textElementProvider; classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.UIMisc); }
protected sealed override ImageReference GetIcon(IDotNetImageService dnImgMgr) => IconReference;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.AssemblyError;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetNamespaceImageReference();
public DocumentViewerToolTipService(IDotNetImageService dotNetImageService, ICodeToolTipSettings codeToolTipSettings, Lazy<IDocumentViewerToolTipProvider, IDocumentViewerToolTipProviderMetadata>[] documentViewerToolTipProviders, IDocumentViewer documentViewer, IQuickInfoBroker quickInfoBroker, IClassificationFormatMap classificationFormatMap, IThemeClassificationTypeService themeClassificationTypeService, IDecompilerService decompilerService) { if (dotNetImageService == null) throw new ArgumentNullException(nameof(dotNetImageService)); if (codeToolTipSettings == null) throw new ArgumentNullException(nameof(codeToolTipSettings)); if (documentViewerToolTipProviders == null) throw new ArgumentNullException(nameof(documentViewerToolTipProviders)); if (documentViewer == null) throw new ArgumentNullException(nameof(documentViewer)); if (quickInfoBroker == null) throw new ArgumentNullException(nameof(quickInfoBroker)); if (classificationFormatMap == null) throw new ArgumentNullException(nameof(classificationFormatMap)); if (themeClassificationTypeService == null) throw new ArgumentNullException(nameof(themeClassificationTypeService)); if (decompilerService == null) throw new ArgumentNullException(nameof(decompilerService)); this.dotNetImageService = dotNetImageService; this.codeToolTipSettings = codeToolTipSettings; this.documentViewerToolTipProviders = documentViewerToolTipProviders; this.documentViewer = documentViewer; this.quickInfoBroker = quickInfoBroker; this.classificationFormatMap = classificationFormatMap; this.themeClassificationTypeService = themeClassificationTypeService; this.decompilerService = decompilerService; }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(Document.AssemblyDef);
DocumentTreeViewProvider(ITreeViewService treeViewService, IDecompilerService decompilerService, IDsDocumentServiceProvider documentServiceProvider, IDocumentTreeViewSettings documentTreeViewSettings, IMenuService menuService, IDotNetImageService dotNetImageService, IWpfCommandService wpfCommandService, IResourceNodeFactory resourceNodeFactory, [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.dsDocumentNodeProviders = dsDocumentNodeProviders.ToArray(); this.mefFinders = mefFinders.ToArray(); this.treeViewNodeTextElementProvider = treeViewNodeTextElementProvider; }
/// <summary> /// Gets the icon shown when the node has been expanded /// </summary> /// <param name="dnImgMgr">Image service</param> /// <returns></returns> protected virtual ImageReference?GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(FieldDef);
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => new ImageReference();
protected abstract ImageReference GetIcon(IDotNetImageService dnImgMgr);
protected override ImageReference?GetExpandedIcon(IDotNetImageService dnImgMgr) => DsImages.FolderOpened;
/// <summary> /// Gets the icon shown when the node has been expanded /// </summary> /// <param name="dnImgMgr">Image service</param> /// <returns></returns> protected virtual ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
DocumentSearcherProvider(IDotNetImageService dotNetImageService, IDecompilerService decompilerService) { this.dotNetImageService = dotNetImageService; this.decompilerService = decompilerService; }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.ModulePublic;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.Reference;
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(TypeDef);
public DocumentSearcher(DocumentSearcherOptions options, IDocumentTreeView documentTreeView, IDotNetImageService dotNetImageService, SearchResultContext searchResultContext) { if (options.Filter == null) { throw new ArgumentException("options.Filter is null", nameof(options)); } if (options.SearchComparer == null) { throw new ArgumentException("options.SearchComparer is null", nameof(options)); } this.options = options.Clone(); this.cancellationTokenSource = new CancellationTokenSource(); this.cancellationToken = cancellationTokenSource.Token; this.filterSearcherOptions = new FilterSearcherOptions { Dispatcher = Dispatcher.CurrentDispatcher, DocumentTreeView = documentTreeView, DotNetImageService = dotNetImageService, Filter = options.Filter, SearchComparer = options.SearchComparer, OnMatch = r => AddSearchResult(r), Context = searchResultContext, CancellationToken = this.cancellationToken, SearchDecompiledData = options.SearchDecompiledData, }; }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.FolderClosed;
/// <inheritdoc/> protected sealed override ImageReference?GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
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); }
DocumentTreeView(ITreeViewService treeViewService, IDecompilerService decompilerService, IDsDocumentService documentService, 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(true, null, treeViewService, decompilerService, documentService, documentTreeViewSettings, menuService, dotNetImageService, wpfCommandService, resourceNodeFactory, appSettings, dsDocumentNodeProviders, mefFinders, treeViewNodeTextElementProvider) { }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => imgRef;
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(); }
protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReferenceModuleRef();
DocumentViewerToolTipServiceProvider(IDotNetImageService dotNetImageService, ICodeToolTipSettings codeToolTipSettings, IQuickInfoBroker quickInfoBroker, IClassificationFormatMapService classificationFormatMapService, IThemeClassificationTypeService themeClassificationTypeService, IDecompilerService decompilerService, [ImportMany] IEnumerable<Lazy<IDocumentViewerToolTipProvider, IDocumentViewerToolTipProviderMetadata>> documentViewerToolTipProviders) { this.dotNetImageService = dotNetImageService; this.codeToolTipSettings = codeToolTipSettings; this.quickInfoBroker = quickInfoBroker; this.classificationFormatMapService = classificationFormatMapService; this.themeClassificationTypeService = themeClassificationTypeService; this.decompilerService = decompilerService; this.documentViewerToolTipProviders = documentViewerToolTipProviders.OrderBy(a => a.Metadata.Order).ToArray(); }