/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see .
*/
using System;
using System.Collections.Generic;
using dnlib.DotNet;
using dnSpy.Contracts.Controls;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Images;
using dnSpy.Contracts.TreeView;
namespace dnSpy.Contracts.Documents.TreeView {
///
/// Document treeview
///
public interface IDocumentTreeView : IDocumentTreeNodeProvider {
///
/// Gets the instance
///
IDsDocumentService DocumentService { get; }
///
/// Gets the instance
///
ITreeView TreeView { get; }
///
/// Gets the instance
///
IDotNetImageService DotNetImageService { get; }
///
/// Gets the instance
///
IWpfCommands WpfCommands { get; }
///
/// Raised when the collection gets changed
///
event EventHandler? CollectionChanged;
///
/// Raised when the node's text has changed
///
event EventHandler? NodesTextChanged;
///
/// Raised when a node gets activated (eg. double clicked)
///
event EventHandler? NodeActivated;
///
/// Raised when selection has changed
///
event EventHandler? SelectionChanged;
///
/// Should only be called by the node that gets activated. Returns true if someone handled it.
///
/// The activated node (should be the caller)
///
bool RaiseNodeActivated(DocumentTreeNodeData node);
///
/// Creates a new instance. This will internally call all
/// s it can find.
///
/// Owner node or null if owner is the root node
/// New document
///
DsDocumentNode CreateNode(DsDocumentNode? owner, IDsDocument document);
///
/// Removes . They must be top nodes (eg. s)
///
/// Nodes
void Remove(IEnumerable nodes);
///
/// Returns a node or null if none could be found
///
/// Reference, eg. a
///
DocumentTreeNodeData? FindNode(object? @ref);
///
/// Returns a node or null if none could be found
///
/// Document
///
DsDocumentNode? FindNode(IDsDocument? document);
///
/// Returns a node or null if none could be found
///
/// Assembly
///
AssemblyDocumentNode? FindNode(AssemblyDef? assembly);
///
/// Returns a node or null if none could be found
///
/// Module
///
ModuleDocumentNode? FindNode(ModuleDef? module);
///
/// Returns a node or null if none could be found
///
/// Type
///
TypeNode? FindNode(TypeDef? type);
///
/// Returns a node or null if none could be found
///
/// Method
///
MethodNode? FindNode(MethodDef? method);
///
/// Returns a node or null if none could be found
///
/// Field
///
FieldNode? FindNode(FieldDef? field);
///
/// Returns a node or null if none could be found
///
/// Property
///
PropertyNode? FindNode(PropertyDef? property);
///
/// Returns a node or null if none could be found
///
/// Event
///
EventNode? FindNode(EventDef? @event);
///
/// Returns a node or null if none could be found
///
/// Owner module
/// Namespace
///
NamespaceNode? FindNamespaceNode(IDsDocument? module, string? @namespace);
///
/// Gets the instance
///
IDocumentTreeNodeGroups DocumentTreeNodeGroups { get; }
///
/// Gets all s
///
///
IEnumerable GetAllModuleNodes();
///
/// Gets all created s
///
///
IEnumerable GetAllCreatedDocumentNodes();
///
/// Adds to the list
///
/// Node
/// Index or -1
void AddNode(DsDocumentNode documentNode, int index);
///
/// Sets decompiler
///
/// Decompiler
void SetDecompiler(IDecompiler decompiler);
///
/// Disposes this instance
///
void Dispose();
///
/// Sorts all documents
///
void SortTopNodes();
///
/// true if can be called
///
bool CanSortTopNodes { get; }
}
}