本文整理汇总了C#中ICSharpCode.TreeView.SharpTreeNode.AddChildAndColorAncestors方法的典型用法代码示例。如果您正苦于以下问题:C# SharpTreeNode.AddChildAndColorAncestors方法的具体用法?C# SharpTreeNode.AddChildAndColorAncestors怎么用?C# SharpTreeNode.AddChildAndColorAncestors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.TreeView.SharpTreeNode
的用法示例。
在下文中一共展示了SharpTreeNode.AddChildAndColorAncestors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportCore
protected override IMetadataTokenProvider ImportCore(MemberImportingOptions options, SharpTreeNode node)
{
//Checks that the task hasn't been canceled
options.CancellationToken.ThrowIfCancellationRequested();
//Adds the field to the destination type
((TypeDefinition)Destination).Fields.Add(fieldClone);
if (_createNode)
node.AddChildAndColorAncestors(new ILEditTreeNode(fieldClone, false));
//Returns the new field
return fieldClone;
}
示例2: ImportCore
protected override IMetadataTokenProvider ImportCore(MemberImportingOptions options, SharpTreeNode node)
{
//Checks that the task hasn't been canceled
options.CancellationToken.ThrowIfCancellationRequested();
//Checks if the destination is a module or a type
if (Destination is ModuleDefinition)
{
//Destination
var dest = (ModuleDefinition)Destination;
dest.Types.Add(typeClone);
//Finds the correct namespace
var ns = typeClone.Namespace;
var moduleNode = Helpers.Tree.GetModuleNode((ModuleDefinition)Destination);
var nsNode = moduleNode.Children.EnsureLazyChildren().OfType<NamespaceTreeNode>().FirstOrDefault(x => x.Name == ns);
if (nsNode != null)
nsNode.AddChildAndColorAncestors(new ILEditTreeNode(typeClone, false));
else
{
nsNode = new NamespaceTreeNode(typeClone.Namespace) { Foreground = GlobalContainer.ModifiedNodesBrush };
nsNode.Children.Add(new ILEditTreeNode(typeClone, false));
moduleNode.AddChildAndColorAncestors(nsNode);
}
}
else
{
//Destination
var dest = (TypeDefinition)Destination;
dest.NestedTypes.Add(typeClone);
node.AddChildAndColorAncestors(new ILEditTreeNode(typeClone, false));
}
//Return
return typeClone;
}