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(); }
public IFieldNode Create(FieldDef field) => (IFieldNode)TreeView.Create(new FieldNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.FieldTreeNodeGroupType), field)).Data;
public IEventNode Create(EventDef @event) => (IEventNode)TreeView.Create(new EventNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.EventTreeNodeGroupType), @event)).Data;
public IPropertyNode Create(PropertyDef property) => (IPropertyNode)TreeView.Create(new PropertyNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.PropertyTreeNodeGroupType), property)).Data;
public IMethodNode Create(MethodDef method) => (IMethodNode)TreeView.Create(new MethodNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.MethodTreeNodeGroupType), method)).Data;
public ITypeNode CreateNested(TypeDef type) => (ITypeNode)TreeView.Create(new TypeNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.TypeTreeNodeGroupType), type)).Data;
public INamespaceNode Create(string name) => (INamespaceNode)TreeView.Create(new NamespaceNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.NamespaceTreeNodeGroupModule), name, new List <TypeDef>())).Data;
public IModuleReferenceNode Create(ModuleRef modRef) => (IModuleReferenceNode)TreeView.Create(new ModuleReferenceNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.ModuleRefTreeNodeGroupReferences), modRef)).Data;
public IAssemblyReferenceNode Create(AssemblyRef asmRef, ModuleDef ownerModule) => (IAssemblyReferenceNode)TreeView.Create(new AssemblyReferenceNode(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.AssemblyRefTreeNodeGroupReferences), ownerModule, asmRef)).Data;
public TypeNode Create(TypeDef type) => (TypeNode)TreeView.Create(new TypeNodeImpl(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.TypeTreeNodeGroupNamespace), type)).Data;
public MethodNode CreateProperty(MethodDef method) => (MethodNode)TreeView.Create(new MethodNodeImpl(DocumentTreeNodeGroups.GetGroup(DocumentTreeNodeGroupType.MethodTreeNodeGroupProperty), method)).Data;