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; }
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"); }
public CodeToolTipCreator(IImageManager imageManager, IDotNetImageManager dotNetImageManager, bool syntaxHighlight) { this.imageManager = imageManager; this.dotNetImageManager = dotNetImageManager; this.syntaxHighlight = syntaxHighlight; this.writers = new List<CodeToolTipWriter>(); CreateNewOutput(); }
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(); }
protected virtual ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr) { return null; }
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); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return dnImgMgr.GetNamespaceImageReference(); }
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(); }
protected sealed override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, IconName);
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(); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReference(analyzedEvent);
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return imgRef; }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(dnImgMgr.GetImageReference(field)); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetNamespaceImageReference();
protected sealed override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return new ImageReference(GetType().Assembly, IconName); }
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"); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "AssemblyWarning");
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReference(DnSpyFile.ModuleDef);
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return dnImgMgr.GetImageReference(property); }
protected abstract ImageReference GetIcon(IDotNetImageManager dnImgMgr);
protected virtual ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) { return(null); }
protected virtual ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => null;
protected override sealed ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr) { return null; }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "ModuleFile");
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) { }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(new ImageReference(GetType().Assembly, "BaseTypeClosed")); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(imgRef); }
protected override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) { return(new ImageReference(GetType().Assembly, "BaseTypeOpened")); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "DerivedTypesClosed");
protected override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => new ImageReference(GetType().Assembly, "DerivedTypesOpened");
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReference(TypeDef);
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return new ImageReference(GetType().Assembly, "BaseTypeClosed"); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return dnImgMgr.GetImageReference(DnSpyFile.PEImage); }
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); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return new ImageReference(GetType().Assembly, "TextFile"); }
/// <inheritdoc/> protected sealed override ImageReference?GetExpandedIcon(IDotNetImageManager dnImgMgr) => null;
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => dnImgMgr.GetImageReferenceModuleRef();
protected override ImageReference? GetExpandedIcon(IDotNetImageManager dnImgMgr) { return new ImageReference(GetType().Assembly, "BaseTypeOpened"); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) => imgRef;
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { var td = TryGetTypeDef(); if (td != null) return dnImgMgr.GetImageReference(td); return new ImageReference(GetType().Assembly, "Class"); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(dnImgMgr.GetImageReferenceAssemblyRef()); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return dnImgMgr.GetImageReference(analyzedField); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(dnImgMgr.GetImageReference(analyzedType)); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return dnImgMgr.GetImageReferenceModuleRef(); }
protected override ImageReference GetIcon(IDotNetImageManager dnImgMgr) { return(dnImgMgr.GetImageReference(DnSpyFile.PEImage)); }