예제 #1
0
 CodeToolTipManager(IImageManager imageManager, IDotNetImageManager dotNetImageManager, ICodeToolTipSettings codeToolTipSettings, [ImportMany] IEnumerable<Lazy<IToolTipContentCreator, IToolTipContentCreatorMetadata>> mefCreators)
 {
     this.imageManager = imageManager;
     this.dotNetImageManager = dotNetImageManager;
     this.codeToolTipSettings = codeToolTipSettings;
     this.creators = mefCreators.OrderBy(a => a.Metadata.Order).ToArray();
 }
 public ToolTipContentCreatorContext(IImageManager imageManager, IDotNetImageManager dotNetImageManager, ILanguage language, ICodeToolTipSettings codeToolTipSettings)
 {
     this.imageManager = imageManager;
     this.dotNetImageManager = dotNetImageManager;
     this.language = language;
     this.codeToolTipSettings = codeToolTipSettings;
 }
예제 #3
0
		protected sealed override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			var imgRef = GetIcon();
			if (imgRef.Assembly != null)
				return imgRef;
			var asm = dnImgMgr.GetType().Assembly;
			return ResourceUtils.TryGetImageReference(asm, resource.Name) ?? new ImageReference(asm, "Resource");
		}
예제 #4
0
 public CodeToolTipCreator(IImageManager imageManager, IDotNetImageManager dotNetImageManager, bool syntaxHighlight)
 {
     this.imageManager = imageManager;
     this.dotNetImageManager = dotNetImageManager;
     this.syntaxHighlight = syntaxHighlight;
     this.writers = new List<CodeToolTipWriter>();
     CreateNewOutput();
 }
예제 #5
0
 FileTreeViewCreator(IThemeManager themeManager, ITreeViewManager treeViewManager, ILanguageManager languageManager, IFileManagerCreator fileManagerCreator, IFileTreeViewSettings fileTreeViewSettings, IMenuManager menuManager, IDotNetImageManager dotNetImageManager, IWpfCommandManager wpfCommandManager, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable<Lazy<IDnSpyFileNodeCreator, IDnSpyFileNodeCreatorMetadata>> dnSpyFileNodeCreators, [ImportMany] IEnumerable<Lazy<IFileTreeNodeDataFinder, IFileTreeNodeDataFinderMetadata>> mefFinders)
 {
     this.themeManager = themeManager;
     this.treeViewManager = treeViewManager;
     this.languageManager = languageManager;
     this.fileManagerCreator = fileManagerCreator;
     this.fileTreeViewSettings = fileTreeViewSettings;
     this.menuManager = menuManager;
     this.dotNetImageManager = dotNetImageManager;
     this.wpfCommandManager = wpfCommandManager;
     this.resourceNodeFactory = resourceNodeFactory;
     this.appSettings = appSettings;
     this.dnSpyFileNodeCreators = dnSpyFileNodeCreators.ToArray();
     this.mefFinders = mefFinders.ToArray();
 }
예제 #6
0
		protected virtual ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr) {
			return null;
		}
예제 #7
0
        AnalyzerManager(IWpfCommandManager wpfCommandManager, IFileTabManager fileTabManager, ITreeViewManager treeViewManager, IMenuManager menuManager, IThemeManager themeManager, IAnalyzerSettings analyzerSettings, IDotNetImageManager dotNetImageManager, IDecompilerManager decompilerManager)
        {
            this.fileTabManager = fileTabManager;

            this.context = new AnalyzerTreeNodeDataContext {
                DotNetImageManager         = dotNetImageManager,
                Decompiler                 = decompilerManager.Decompiler,
                FileManager                = fileTabManager.FileTreeView.FileManager,
                ShowToken                  = analyzerSettings.ShowToken,
                SingleClickExpandsChildren = analyzerSettings.SingleClickExpandsChildren,
                SyntaxHighlight            = analyzerSettings.SyntaxHighlight,
                UseNewRenderer             = analyzerSettings.UseNewRenderer,
                AnalyzerManager            = this,
            };

            var options = new TreeViewOptions {
                CanDragAndDrop   = false,
                TreeViewListener = this,
            };

            this.TreeView = treeViewManager.Create(ANALYZER_TREEVIEW_GUID, options);

            fileTabManager.FileTreeView.FileManager.CollectionChanged += FileManager_CollectionChanged;
            fileTabManager.FileModified         += FileTabManager_FileModified;
            decompilerManager.DecompilerChanged += DecompilerManager_DecompilerChanged;
            themeManager.ThemeChanged           += ThemeManager_ThemeChanged;
            analyzerSettings.PropertyChanged    += AnalyzerSettings_PropertyChanged;

            menuManager.InitializeContextMenu((FrameworkElement)this.TreeView.UIObject, new Guid(MenuConstants.GUIDOBJ_ANALYZER_TREEVIEW_GUID), new GuidObjectsProvider(this.TreeView));
            wpfCommandManager.Add(ControlConstants.GUID_ANALYZER_TREEVIEW, (UIElement)this.TreeView.UIObject);
            var cmds    = wpfCommandManager.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);
        }
예제 #8
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return dnImgMgr.GetNamespaceImageReference();
 }
예제 #9
0
        public FileTreeView(bool isGlobal, IFileTreeNodeFilter filter, IThemeManager themeManager, ITreeViewManager treeViewManager, IDecompilerManager decompilerManager, IFileManager fileManager, IFileTreeViewSettings fileTreeViewSettings, IMenuManager menuManager, IDotNetImageManager dotNetImageManager, IWpfCommandManager wpfCommandManager, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable <Lazy <IDnSpyFileNodeProvider, IDnSpyFileNodeProviderMetadata> > dnSpyFileNodeProviders, [ImportMany] IEnumerable <Lazy <IFileTreeNodeDataFinder, IFileTreeNodeDataFinderMetadata> > mefFinders)
        {
            this.decompilerManager    = decompilerManager;
            this.themeManager         = themeManager;
            this.fileTreeViewSettings = fileTreeViewSettings;
            this.appSettings          = appSettings;

            this.context = new FileTreeNodeDataContext(this, resourceNodeFactory, filter ?? FilterNothingFileTreeNodeFilter.Instance)
            {
                SyntaxHighlight            = fileTreeViewSettings.SyntaxHighlight,
                SingleClickExpandsChildren = fileTreeViewSettings.SingleClickExpandsTreeViewChildren,
                ShowAssemblyVersion        = fileTreeViewSettings.ShowAssemblyVersion,
                ShowAssemblyPublicKeyToken = fileTreeViewSettings.ShowAssemblyPublicKeyToken,
                ShowToken            = fileTreeViewSettings.ShowToken,
                Decompiler           = decompilerManager.Decompiler,
                UseNewRenderer       = appSettings.UseNewRenderer_FileTreeView,
                DeserializeResources = fileTreeViewSettings.DeserializeResources,
                CanDragAndDrop       = isGlobal,
            };

            var options = new TreeViewOptions {
                AllowDrop          = true,
                IsVirtualizing     = true,
                VirtualizationMode = VirtualizationMode.Recycling,
                TreeViewListener   = this,
                RootNode           = new RootNode {
                    DropNodes = OnDropNodes,
                    DropFiles = OnDropFiles,
                },
            };

            this.fileTreeNodeGroups     = new FileTreeNodeGroups();
            this.dnSpyFileNodeProviders = dnSpyFileNodeProviders.OrderBy(a => a.Metadata.Order).ToArray();
            this.TreeView = treeViewManager.Create(new Guid(TVConstants.FILE_TREEVIEW_GUID), options);
            this.TreeView.SelectionChanged += TreeView_SelectionChanged;
            this.FileManager        = fileManager;
            this.DotNetImageManager = dotNetImageManager;
            this.dispatcher         = Dispatcher.CurrentDispatcher;
            this.FileManager.SetDispatcher(AddAction);
            fileManager.CollectionChanged        += FileManager_CollectionChanged;
            decompilerManager.DecompilerChanged  += DecompilerManager_DecompilerChanged;
            themeManager.ThemeChanged            += ThemeManager_ThemeChanged;
            fileTreeViewSettings.PropertyChanged += FileTreeViewSettings_PropertyChanged;
            appSettings.PropertyChanged          += AppSettings_PropertyChanged;

            this.WpfCommands = wpfCommandManager.GetCommands(ControlConstants.GUID_FILE_TREEVIEW);

            if (isGlobal)
            {
                menuManager.InitializeContextMenu((FrameworkElement)this.TreeView.UIObject, new Guid(MenuConstants.GUIDOBJ_FILES_TREEVIEW_GUID), new GuidObjectsProvider(this.TreeView));
                wpfCommandManager.Add(ControlConstants.GUID_FILE_TREEVIEW, (UIElement)TreeView.UIObject);
            }

            this.nodeFinders = mefFinders.OrderBy(a => a.Metadata.Order).ToArray();
            InitializeFileTreeNodeGroups();
        }
예제 #10
0
 protected sealed override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, IconName);
예제 #11
0
 FileTreeViewCreator(IThemeManager themeManager, ITreeViewManager treeViewManager, ILanguageManager languageManager, IFileManagerCreator fileManagerCreator, IFileTreeViewSettings fileTreeViewSettings, IMenuManager menuManager, IDotNetImageManager dotNetImageManager, IWpfCommandManager wpfCommandManager, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable <Lazy <IDnSpyFileNodeCreator, IDnSpyFileNodeCreatorMetadata> > dnSpyFileNodeCreators, [ImportMany] IEnumerable <Lazy <IFileTreeNodeDataFinder, IFileTreeNodeDataFinderMetadata> > mefFinders)
 {
     this.themeManager          = themeManager;
     this.treeViewManager       = treeViewManager;
     this.languageManager       = languageManager;
     this.fileManagerCreator    = fileManagerCreator;
     this.fileTreeViewSettings  = fileTreeViewSettings;
     this.menuManager           = menuManager;
     this.dotNetImageManager    = dotNetImageManager;
     this.wpfCommandManager     = wpfCommandManager;
     this.resourceNodeFactory   = resourceNodeFactory;
     this.appSettings           = appSettings;
     this.dnSpyFileNodeCreators = dnSpyFileNodeCreators.ToArray();
     this.mefFinders            = mefFinders.ToArray();
 }
예제 #12
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReference(analyzedEvent);
예제 #13
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return imgRef;
 }
예제 #14
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(dnImgMgr.GetImageReference(field));
 }
예제 #15
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) =>
 dnImgMgr.GetNamespaceImageReference();
예제 #16
0
파일: HexNode.cs 프로젝트: lovebanyi/dnSpy
		protected sealed override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			return new ImageReference(GetType().Assembly, IconName);
		}
예제 #17
0
		protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			// The image must be in an Images folder (in the resources) and have a .png extension
			return new ImageReference(GetType().Assembly, "EntryPoint");
		}
예제 #18
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) =>
 new ImageReference(GetType().Assembly, "AssemblyWarning");
예제 #19
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) =>
 dnImgMgr.GetImageReference(DnSpyFile.ModuleDef);
예제 #20
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return dnImgMgr.GetImageReference(property);
 }
예제 #21
0
 protected abstract ImageReference GetIcon(IDotNetImageManager dnImgMgr);
예제 #22
0
 protected virtual ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr)
 {
     return(null);
 }
예제 #23
0
 protected virtual ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => null;
예제 #24
0
 protected override sealed ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr)
 {
     return null;
 }
예제 #25
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "ModuleFile");
예제 #26
0
 FileTreeView(IThemeManager themeManager, ITreeViewManager treeViewManager, IDecompilerManager decompilerManager, IFileManager fileManager, IFileTreeViewSettings fileTreeViewSettings, IMenuManager menuManager, IDotNetImageManager dotNetImageManager, IWpfCommandManager wpfCommandManager, IResourceNodeFactory resourceNodeFactory, IAppSettings appSettings, [ImportMany] IEnumerable <Lazy <IDnSpyFileNodeProvider, IDnSpyFileNodeProviderMetadata> > dnSpyFileNodeProviders, [ImportMany] IEnumerable <Lazy <IFileTreeNodeDataFinder, IFileTreeNodeDataFinderMetadata> > mefFinders)
     : this(true, null, themeManager, treeViewManager, decompilerManager, fileManager, fileTreeViewSettings, menuManager, dotNetImageManager, wpfCommandManager, resourceNodeFactory, appSettings, dnSpyFileNodeProviders, mefFinders)
 {
 }
예제 #27
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(new ImageReference(GetType().Assembly, "BaseTypeClosed"));
 }
예제 #28
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(imgRef);
 }
예제 #29
0
 protected override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr)
 {
     return(new ImageReference(GetType().Assembly, "BaseTypeOpened"));
 }
예제 #30
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "DerivedTypesClosed");
예제 #31
0
 protected override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "DerivedTypesOpened");
예제 #32
0
파일: TypeNode.cs 프로젝트: net10010/dnSpy
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) =>
 dnImgMgr.GetImageReference(TypeDef);
예제 #33
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return new ImageReference(GetType().Assembly, "BaseTypeClosed");
 }
예제 #34
0
		protected abstract ImageReference GetIcon(IDotNetImageManager dnImgMgr);
예제 #35
0
		protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			return dnImgMgr.GetImageReference(DnSpyFile.PEImage);
		}
예제 #36
0
		AnalyzerManager(IWpfCommandManager wpfCommandManager, IFileTabManager fileTabManager, ITreeViewManager treeViewManager, IMenuManager menuManager, IThemeManager themeManager, IAnalyzerSettings analyzerSettings, IDotNetImageManager dotNetImageManager, ILanguageManager languageManager, IFileManager fileManager) {
			this.fileTabManager = fileTabManager;

			this.context = new AnalyzerTreeNodeDataContext {
				DotNetImageManager = dotNetImageManager,
				Language = languageManager.SelectedLanguage,
				FileManager = fileManager,
				ShowToken = analyzerSettings.ShowToken,
				SingleClickExpandsChildren = analyzerSettings.SingleClickExpandsChildren,
				SyntaxHighlight = analyzerSettings.SyntaxHighlight,
				UseNewRenderer = analyzerSettings.UseNewRenderer,
				AnalyzerManager = this,
			};

			var options = new TreeViewOptions {
				CanDragAndDrop = false,
				TreeViewListener = this,
			};
			this.treeView = treeViewManager.Create(ANALYZER_TREEVIEW_GUID, options);

			fileManager.CollectionChanged += FileManager_CollectionChanged;
			fileTabManager.FileModified += FileTabManager_FileModified;
			languageManager.LanguageChanged += LanguageManager_LanguageChanged;
			themeManager.ThemeChanged += ThemeManager_ThemeChanged;
			analyzerSettings.PropertyChanged += AnalyzerSettings_PropertyChanged;

			menuManager.InitializeContextMenu((FrameworkElement)this.treeView.UIObject, new Guid(MenuConstants.GUIDOBJ_ANALYZER_TREEVIEW_GUID), new GuidObjectsCreator(this.treeView));
			wpfCommandManager.Add(CommandConstants.GUID_ANALYZER_TREEVIEW, (UIElement)this.treeView.UIObject);
			var cmds = wpfCommandManager.GetCommands(CommandConstants.GUID_ANALYZER_TREEVIEW);
			var command = new RelayCommand(a => ActivateNode());
			cmds.Add(command, ModifierKeys.Control, Key.Enter);
			cmds.Add(command, ModifierKeys.Shift, Key.Enter);
		}
예제 #37
0
		protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			return new ImageReference(GetType().Assembly, "TextFile");
		}
예제 #38
0
 /// <inheritdoc/>
 protected sealed override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => null;
예제 #39
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReferenceModuleRef();
예제 #40
0
 protected override ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr)
 {
     return new ImageReference(GetType().Assembly, "BaseTypeOpened");
 }
예제 #41
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => imgRef;
예제 #42
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     var td = TryGetTypeDef();
     if (td != null)
         return dnImgMgr.GetImageReference(td);
     return new ImageReference(GetType().Assembly, "Class");
 }
예제 #43
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(dnImgMgr.GetImageReferenceAssemblyRef());
 }
예제 #44
0
		protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) {
			return dnImgMgr.GetImageReference(analyzedField);
		}
예제 #45
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(dnImgMgr.GetImageReference(analyzedType));
 }
예제 #46
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return dnImgMgr.GetImageReferenceModuleRef();
 }
예제 #47
0
 protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr)
 {
     return(dnImgMgr.GetImageReference(DnSpyFile.PEImage));
 }