本文整理汇总了C#中IFileTreeNodeData类的典型用法代码示例。如果您正苦于以下问题:C# IFileTreeNodeData类的具体用法?C# IFileTreeNodeData怎么用?C# IFileTreeNodeData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFileTreeNodeData类属于命名空间,在下文中一共展示了IFileTreeNodeData类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Create
FileTabReferenceResult Create(IFileTreeNodeData node)
{
var content = fileTabContentFactoryManager.CreateTabContent(new IFileTreeNodeData[] { node });
if (content == null)
return null;
return new FileTabReferenceResult(content);
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:7,代码来源:NodeReferenceFileTabContentCreator.cs
示例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;
}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:9,代码来源:NodeTabSaver.cs
示例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;
}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:10,代码来源:FileTabContentFactoryManager.cs
示例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;
}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:10,代码来源:FileTabContentFactoryManager.cs
示例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]);
}
}
开发者ID:GreenDamTan,项目名称:dnSpy,代码行数:20,代码来源:FileTreeNodeDecompiler.cs
示例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));
}
开发者ID:levisre,项目名称:dnSpy,代码行数:4,代码来源:FieldDefCommands.cs
示例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));
}
开发者ID:levisre,项目名称:dnSpy,代码行数:10,代码来源:FieldDefCommands.cs
示例8: GetChildren
IFileTreeNodeData[] GetChildren(IFileTreeNodeData node)
{
var n = node;
return (IFileTreeNodeData[])execInThread(() => {
n.TreeNode.EnsureChildrenLoaded();
return n.TreeNode.DataChildren.OfType<IFileTreeNodeData>().ToArray();
});
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:8,代码来源:NodeDecompiler.cs
示例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));
}
开发者ID:levisre,项目名称:dnSpy,代码行数:30,代码来源:ResourceCommands.cs
示例10: FileTreeNodeActivatedEventArgs
/// <summary>
/// Constructor
/// </summary>
/// <param name="node">Node</param>
public FileTreeNodeActivatedEventArgs(IFileTreeNodeData node) {
if (node == null)
throw new ArgumentNullException();
this.Node = node;
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:9,代码来源:FileTreeNodeActivatedEventArgs.cs
示例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;
}
开发者ID:levisre,项目名称:dnSpy,代码行数:22,代码来源:ResourceCommands.cs
示例12: CanExecuteResourceListCommand
public static bool CanExecuteResourceListCommand(IFileTreeNodeData[] nodes) {
return GetResourceListTreeNode(nodes) != null;
}
开发者ID:levisre,项目名称:dnSpy,代码行数:3,代码来源:ResourceCommands.cs
示例13: CanExecute
static bool CanExecute(IFileTreeNodeData[] nodes) {
return nodes.Length > 0 &&
nodes.All(n => n is IResourceElementNode);
}
开发者ID:levisre,项目名称:dnSpy,代码行数:4,代码来源:ResourceCommands.cs
示例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();
}
开发者ID:levisre,项目名称:dnSpy,代码行数:15,代码来源:FieldDefCommands.cs
示例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;
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:49,代码来源:NodeDecompiler.cs
示例16: GetNodeType
static NodeType GetNodeType(IFileTreeNodeData node)
{
NodeType nodeType;
var type = node.GetType();
lock (lockObj) {
if (toNodeType.TryGetValue(type, out nodeType))
return nodeType;
nodeType = GetNodeTypeSlow(node);
toNodeType.Add(type, nodeType);
}
return nodeType;
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:13,代码来源:NodeDecompiler.cs
示例17: DecompileUnknown
void DecompileUnknown(IFileTreeNodeData node)
{
var decompileSelf = node as IDecompileSelf;
if (decompileSelf != null && decompileNodeContext != null) {
if (decompileSelf.Decompile(decompileNodeContext))
return;
}
language.WriteCommentLine(output, node.ToString(language));
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:9,代码来源:NodeDecompiler.cs
示例18: GetHeader
static string GetHeader(IFileTreeNodeData[] nodes) {
if (nodes.Length == 1)
return string.Format(dnSpy_AsmEditor_Resources.DeleteX, UIUtils.EscapeMenuItemHeader(nodes[0].ToString()));
return string.Format(dnSpy_AsmEditor_Resources.DeleteFieldsCommand, nodes.Length);
}
开发者ID:levisre,项目名称:dnSpy,代码行数:5,代码来源:FieldDefCommands.cs
示例19: Decompile
public void Decompile(IFileTreeNodeData node)
{
var nodeType = GetNodeType(node);
switch (nodeType) {
case NodeType.Unknown:
DecompileUnknown(node);
break;
case NodeType.Assembly:
language.Decompile(((IAssemblyFileNode)node).DnSpyFile.AssemblyDef, output, decompilationContext);
break;
case NodeType.Module:
language.Decompile(((IModuleFileNode)node).DnSpyFile.ModuleDef, output, decompilationContext);
break;
case NodeType.Type:
language.Decompile(((ITypeNode)node).TypeDef, output, decompilationContext);
break;
case NodeType.Method:
language.Decompile(((IMethodNode)node).MethodDef, output, decompilationContext);
break;
case NodeType.Field:
language.Decompile(((IFieldNode)node).FieldDef, output, decompilationContext);
break;
case NodeType.Property:
language.Decompile(((IPropertyNode)node).PropertyDef, output, decompilationContext);
break;
case NodeType.Event:
language.Decompile(((IEventNode)node).EventDef, output, decompilationContext);
break;
case NodeType.AssemblyRef:
Decompile((IAssemblyReferenceNode)node);
break;
case NodeType.BaseTypeFolder:
Decompile((IBaseTypeFolderNode)node);
break;
case NodeType.BaseType:
Decompile((IBaseTypeNode)node);
break;
case NodeType.DerivedType:
Decompile((IDerivedTypeNode)node);
break;
case NodeType.DerivedTypesFolder:
Decompile((IDerivedTypesFolderNode)node);
break;
case NodeType.ModuleRef:
Decompile((IModuleReferenceNode)node);
break;
case NodeType.Namespace:
Decompile((INamespaceNode)node);
break;
case NodeType.PEFile:
Decompile((IPEFileNode)node);
break;
case NodeType.ReferencesFolder:
Decompile((IReferencesFolderNode)node);
break;
case NodeType.ResourcesFolder:
Decompile((IResourcesFolderNode)node);
break;
case NodeType.Resource:
Decompile((IResourceNode)node);
break;
case NodeType.ResourceElement:
Decompile((IResourceElementNode)node);
break;
case NodeType.ResourceElementSet:
Decompile((IResourceElementSetNode)node);
break;
case NodeType.UnknownFile:
Decompile((IUnknownFileNode)node);
break;
case NodeType.Message:
Decompile((IMessageNode)node);
break;
default:
Debug.Fail(string.Format("Unknown NodeType: {0}", nodeType));
goto case NodeType.Unknown;
}
//.........这里部分代码省略.........
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:101,代码来源:NodeDecompiler.cs
注:本文中的IFileTreeNodeData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论