本文整理汇总了C#中System.Windows.Forms.TreeNode.GetInfo方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.GetInfo方法的具体用法?C# TreeNode.GetInfo怎么用?C# TreeNode.GetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeNode
的用法示例。
在下文中一共展示了TreeNode.GetInfo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandNode
/// <summary>
/// Expands the nodeInfo.
/// </summary>
/// <param name="nodeInfo">The nodeInfo.</param>
/// <returns>false to cancel</returns>
public bool ExpandNode(TreeNode node)
{
// get rid of the dummy
TreeNode[] removeNodes = node.Nodes.Cast<TreeNode>().ToArray();
NodeInfo nodeInfo = node.GetInfo();
return this.AddSubNodes(nodeInfo, () =>
{
// remove the original nodeInfo when finished
foreach (TreeNode n in removeNodes)
{
this.Nodes.Remove(n);
}
});
}
示例2: AddList
/// <summary>
/// Returns all the exceptions that a tree nodeInfo and it's child nodeInfo point to.
/// </summary>
/// <param name="nodeInfo">The nodeInfo.</param>
/// <returns>
/// The exceptions that a nodeInfo and it's child nodeInfo point to.
/// </returns>
private IEnumerable<ThrownException> AddList(TreeNode node)
{
Class cls = node.GetInfo().GetAnalysisObject<Class>();
IEnumerable<ThrownException> l = null;
if (cls != null)
{
Type type = cls.ClassType;
l = this.ExceptionTree.ExceptionDictionary.GetList(type);
}
else
{
l = new ThrownException[] { };
}
foreach (TreeNode child in node.Nodes)
{
l = l.Concat(this.AddList(child));
}
node.GetInfo().ExtraData = l;
return l;
}
示例3: Create
public static ReloadNode Create(TreeNode node)
{
AssemblyItem asm = node.GetInfo().GetAnalysisObject<AssemblyItem>();
if (asm == null)
{
return null;
}
return new ReloadNode()
{
Filename = asm.Assembly.Location,
Expanded = node.IsExpanded
};
}
示例4: UpdateNode
private void UpdateNode(TreeNode node)
{
NodeInfo info = node.GetInfo();
if (info != null)
{
node.GetInfo().UpdateNode();
}
foreach (TreeNode child in node.Nodes)
{
this.UpdateNode(child);
}
}
示例5: ShowCallStack
public void ShowCallStack(CallStack callStack, TreeNode startAt, CancellationToken cancelToken)
{
if (callStack.Count == 0)
{
return;
}
// start from the bottom of the stack
CallStack stack = new CallStack(callStack.Reverse());
TreeNode lastExistingNode = null;
TreeNode newNodesRoot = null;
NodeInfo nodeInfo = startAt.GetInfo();
TreeNode node = nodeInfo.Node;
TreeNode lastNode = node;
bool first = nodeInfo.GetAnalysisObject<Method>() == stack.Peek();
while (stack.Count >= 0)
{
if ((node.Nodes.Count == 0) || (node.Nodes[0].Tag == null))
{
// hasn't got the child nodeInfo yet.
nodeInfo = node.GetInfo();
if (newNodesRoot == null)
{
lastExistingNode = node;
node = newNodesRoot = new TreeNode();
}
else
{
node.Nodes.Clear();
}
TreeNode[] childNodes = this.CreateSubNodes(nodeInfo, cancelToken);
node.Nodes.AddRange(childNodes);
}
lastNode = node;
if (stack.Count == 0)
{
break;
}
Method method = stack.Pop();
if (!first)
{
node = this.FindNode(ni => ni.GetAnalysisObject<Method>() == method, node, 1);
}
first = false;
}
this.InvokeIfRequired(() =>
{
if ((lastExistingNode.Nodes.Count == 0) || (lastExistingNode.Nodes[0].Tag == null))
{
lastExistingNode.Nodes.Clear();
}
lastExistingNode.Nodes.AddRange(newNodesRoot.Nodes.Cast<TreeNode>().ToArray());
lastNode.EnsureVisible();
this.SelectedNode = lastNode;
});
}
示例6: ReloadClassNodes
public void ReloadClassNodes(TreeNode node)
{
NodeInfo info = node.GetInfo();
if ((info != null) && info.Type.HasFlag(NodeType.Class))
{
node.Collapse(true);
node.Nodes.Clear();
node.Nodes.Add(this.CreateLazyDummyNode());
return;
}
foreach (TreeNode n in node.Nodes)
{
this.ReloadClassNodes(n);
}
}