Ejemplo n.º 1
0
		/// <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;
		}
Ejemplo n.º 2
0
		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;
		}
Ejemplo n.º 3
0
		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();
		}
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) {
			var td = TryGetTypeDef();
			if (td != null)
				return dnImgMgr.GetImageReference(td);
			return isBaseType ? DsImages.ClassPublic : DsImages.InterfacePublic;
		}
Ejemplo n.º 6
0
		protected override ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => DsImages.FolderOpened;
Ejemplo n.º 7
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(analyzedProperty);
Ejemplo n.º 8
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) =>
			dnImgMgr.GetImageReference(Document.ModuleDef);
Ejemplo n.º 9
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.TextFile;
Ejemplo n.º 10
0
		/// <summary>
		/// Gets the icon
		/// </summary>
		/// <param name="dnImgMgr">Image service</param>
		/// <returns></returns>
		protected abstract ImageReference GetIcon(IDotNetImageService dnImgMgr);
Ejemplo n.º 11
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReferenceModuleRef();
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(analyzedProperty);
Ejemplo n.º 14
0
		protected sealed override ImageReference GetIcon(IDotNetImageService dnImgMgr) => IconReference;
Ejemplo n.º 15
0
		/// <inheritdoc/>
		protected sealed override ImageReference? GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
Ejemplo n.º 16
0
		DocumentSearcherProvider(IDotNetImageService dotNetImageService, IDecompilerService decompilerService, ITextElementProvider textElementProvider, IClassificationFormatMapService classificationFormatMapService) {
			this.dotNetImageService = dotNetImageService;
			this.decompilerService = decompilerService;
			this.textElementProvider = textElementProvider;
			classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.UIMisc);
		}
Ejemplo n.º 17
0
 protected sealed override ImageReference GetIcon(IDotNetImageService dnImgMgr) => IconReference;
Ejemplo n.º 18
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.AssemblyError;
Ejemplo n.º 19
0
 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;
		}
Ejemplo n.º 21
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(Document.AssemblyDef);
Ejemplo n.º 22
0
 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;
 }
Ejemplo n.º 23
0
 /// <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;
Ejemplo n.º 24
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => dnImgMgr.GetImageReference(FieldDef);
Ejemplo n.º 25
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) =>
 new ImageReference();
Ejemplo n.º 26
0
 protected abstract ImageReference GetIcon(IDotNetImageService dnImgMgr);
Ejemplo n.º 27
0
 protected override ImageReference?GetExpandedIcon(IDotNetImageService dnImgMgr) => DsImages.FolderOpened;
Ejemplo n.º 28
0
		/// <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;
Ejemplo n.º 29
0
 DocumentSearcherProvider(IDotNetImageService dotNetImageService, IDecompilerService decompilerService)
 {
     this.dotNetImageService = dotNetImageService;
     this.decompilerService  = decompilerService;
 }
Ejemplo n.º 30
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.ModulePublic;
Ejemplo n.º 31
0
 protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.Reference;
Ejemplo n.º 32
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) =>
			dnImgMgr.GetImageReference(TypeDef);
Ejemplo n.º 33
0
 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,
     };
 }
Ejemplo n.º 34
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => DsImages.FolderClosed;
Ejemplo n.º 35
0
 /// <inheritdoc/>
 protected sealed override ImageReference?GetExpandedIcon(IDotNetImageService dnImgMgr) => null;
Ejemplo n.º 36
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);
		}
Ejemplo n.º 37
0
 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)
 {
 }
Ejemplo n.º 38
0
		protected override ImageReference GetIcon(IDotNetImageService dnImgMgr) => imgRef;
Ejemplo n.º 39
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();
        }
Ejemplo n.º 40
0
		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();
		}