本文整理汇总了C#中IFileTreeNodeData类的典型用法代码示例。如果您正苦于以下问题:C# IFileTreeNodeData类的具体用法?C# IFileTreeNodeData怎么用?C# IFileTreeNodeData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFileTreeNodeData类属于命名空间,在下文中一共展示了IFileTreeNodeData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
FileTabReferenceResult Create(IFileTreeNodeData node)
{
var content = fileTabContentFactoryManager.CreateTabContent(new IFileTreeNodeData[] { node });
if (content == null)
return null;
return new FileTabReferenceResult(content);
}
示例2: NodeTabSaver
NodeTabSaver(IMessageBoxManager messageBoxManager, IFileTab tab, IFileTreeNodeDecompiler fileTreeNodeDecompiler, ILanguage language, ITextEditorUIContext uiContext, IFileTreeNodeData[] nodes)
{
this.messageBoxManager = messageBoxManager;
this.tab = tab;
this.fileTreeNodeDecompiler = fileTreeNodeDecompiler;
this.language = language;
this.uiContext = uiContext;
this.nodes = nodes;
}
示例3: CreateTabContent
public IFileTabContent CreateTabContent(IFileTreeNodeData[] nodes)
{
var context = new FileTabContentFactoryContext(nodes);
foreach (var factory in tabContentFactories) {
var tabContent = factory.Value.Create(context);
if (tabContent != null)
return tabContent;
}
return null;
}
示例4: Deserialize
public IFileTabContent Deserialize(Guid guid, ISettingsSection section, IFileTreeNodeData[] nodes)
{
var context = new FileTabContentFactoryContext(nodes);
foreach (var factory in tabContentFactories) {
var content = factory.Value.Deserialize(guid, section, context);
if (content != null)
return content;
}
return null;
}
示例5: Decompile
public void Decompile(IDecompileNodeContext decompileNodeContext, IFileTreeNodeData[] nodes)
{
foreach (var dc in decompileNodeCollections) {
if (dc.Decompile(decompileNodeContext, nodes))
return;
}
if (nodes.Length == 1) {
var ds = nodes[0] as IDecompileSelf;
if (ds != null && ds.Decompile(decompileNodeContext))
return;
}
for (int i = 0; i < nodes.Length; i++) {
decompileNodeContext.DecompilationContext.CancellationToken.ThrowIfCancellationRequested();
if (i > 0)
decompileNodeContext.Output.WriteLine();
DecompileNode(decompileNodeContext, nodes[i]);
}
}
示例6: CanExecute
static bool CanExecute(IFileTreeNodeData[] nodes) {
return nodes.Length == 1 &&
(nodes[0] is ITypeNode || (nodes[0].TreeNode.Parent != null && nodes[0].TreeNode.Parent.Data is ITypeNode));
}
示例7: Execute
static void Execute(Lazy<IUndoCommandManager> undoCommandManager, IFileTreeNodeData[] nodes) {
if (!CanExecute(nodes))
return;
if (!Method.DeleteMethodDefCommand.AskDeleteDef(dnSpy_AsmEditor_Resources.AskDeleteField))
return;
var fieldNodes = nodes.Cast<IFieldNode>().ToArray();
undoCommandManager.Value.Add(new DeleteFieldDefCommand(fieldNodes));
}
示例8: GetChildren
IFileTreeNodeData[] GetChildren(IFileTreeNodeData node)
{
var n = node;
return (IFileTreeNodeData[])execInThread(() => {
n.TreeNode.EnsureChildrenLoaded();
return n.TreeNode.DataChildren.OfType<IFileTreeNodeData>().ToArray();
});
}
示例9: Execute
static void Execute(Lazy<IUndoCommandManager> undoCommandManager, IAppWindow appWindow, IFileTreeNodeData[] nodes) {
if (!CanExecute(nodes))
return;
var imgRsrcElNode = (IImageResourceElementNode)nodes[0];
var options = new ResourceElementOptions(imgRsrcElNode.ResourceElement);
var data = new ImageResourceElementVM(options);
var win = new ImageResourceElementDlg();
win.Title = dnSpy_AsmEditor_Resources.EditResourceCommand2;
win.DataContext = data;
win.Owner = appWindow.MainWindow;
if (win.ShowDialog() != true)
return;
var opts = data.CreateResourceElementOptions();
string error;
try {
error = imgRsrcElNode.CheckCanUpdateData(opts.Create());
}
catch (Exception ex) {
error = string.Format(dnSpy_AsmEditor_Resources.Error_NewResourceDataMustBeImage, ex.Message);
}
if (!string.IsNullOrEmpty(error)) {
Shared.App.MsgBox.Instance.Show(error);
return;
}
undoCommandManager.Value.Add(new ImageResourceElementSettingsCommand(imgRsrcElNode, opts));
}
示例10: FileTreeNodeActivatedEventArgs
/// <summary>
/// Constructor
/// </summary>
/// <param name="node">Node</param>
public FileTreeNodeActivatedEventArgs(IFileTreeNodeData node) {
if (node == null)
throw new ArgumentNullException();
this.Node = node;
}
示例11: GetResourceListTreeNode
public static IResourcesFolderNode GetResourceListTreeNode(IFileTreeNodeData[] nodes) {
if (nodes.Length != 1)
return null;
var rsrcListNode = nodes[0] as IResourcesFolderNode;
if (rsrcListNode != null)
return rsrcListNode;
rsrcListNode = nodes[0].TreeNode.Parent == null ? null : nodes[0].TreeNode.Parent.Data as IResourcesFolderNode;
if (rsrcListNode != null)
return rsrcListNode;
var modNode = nodes[0] as IModuleFileNode;
if (modNode == null)
return null;
modNode.TreeNode.EnsureChildrenLoaded();
rsrcListNode = (IResourcesFolderNode)modNode.TreeNode.DataChildren.FirstOrDefault(a => a is IResourcesFolderNode);
if (rsrcListNode == null) // If not a module node
return null;
rsrcListNode.TreeNode.EnsureChildrenLoaded();
if (rsrcListNode.TreeNode.Children.Count == 0)
return rsrcListNode;
return null;
}
示例12: CanExecuteResourceListCommand
public static bool CanExecuteResourceListCommand(IFileTreeNodeData[] nodes) {
return GetResourceListTreeNode(nodes) != null;
}
示例13: CanExecute
static bool CanExecute(IFileTreeNodeData[] nodes) {
return nodes.Length > 0 &&
nodes.All(n => n is IResourceElementNode);
}
示例14: FieldDefSettingsCommand
FieldDefSettingsCommand(IFieldNode fieldNode, FieldDefOptions options) {
this.fieldNode = fieldNode;
this.newOptions = options;
this.origOptions = new FieldDefOptions(fieldNode.FieldDef);
this.origParentNode = (IFileTreeNodeData)fieldNode.TreeNode.Parent.Data;
this.origParentChildIndex = this.origParentNode.TreeNode.Children.IndexOf(fieldNode.TreeNode);
Debug.Assert(this.origParentChildIndex >= 0);
if (this.origParentChildIndex < 0)
throw new InvalidOperationException();
this.nameChanged = origOptions.Name != newOptions.Name;
if (this.nameChanged)
this.memberRefInfos = RefFinder.FindMemberRefsToThisModule(fieldNode.GetModule()).Where(a => RefFinder.FieldEqualityComparerInstance.Equals(a, fieldNode.FieldDef)).Select(a => new MemberRefInfo(a)).ToArray();
}
示例15: GetNodeTypeSlow
static NodeType GetNodeTypeSlow(IFileTreeNodeData node)
{
if (node is IAssemblyFileNode)
return NodeType.Assembly;
if (node is IModuleFileNode)
return NodeType.Module;
if (node is ITypeNode)
return NodeType.Type;
if (node is IMethodNode)
return NodeType.Method;
if (node is IFieldNode)
return NodeType.Field;
if (node is IPropertyNode)
return NodeType.Property;
if (node is IEventNode)
return NodeType.Event;
if (node is IAssemblyReferenceNode)
return NodeType.AssemblyRef;
if (node is IBaseTypeFolderNode)
return NodeType.BaseTypeFolder;
if (node is IBaseTypeNode)
return NodeType.BaseType;
if (node is IDerivedTypeNode)
return NodeType.DerivedType;
if (node is IDerivedTypesFolderNode)
return NodeType.DerivedTypesFolder;
if (node is IModuleReferenceNode)
return NodeType.ModuleRef;
if (node is INamespaceNode)
return NodeType.Namespace;
if (node is IPEFileNode)
return NodeType.PEFile;
if (node is IReferencesFolderNode)
return NodeType.ReferencesFolder;
if (node is IResourcesFolderNode)
return NodeType.ResourcesFolder;
if (node is IResourceNode)
return NodeType.Resource;
if (node is IResourceElementNode)
return NodeType.ResourceElement;
if (node is IResourceElementSetNode)
return NodeType.ResourceElementSet;
if (node is IUnknownFileNode)
return NodeType.UnknownFile;
if (node is IMessageNode)
return NodeType.Message;
return NodeType.Unknown;
}