当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.GetInfo方法代码示例

本文整理汇总了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);
                }
            });
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:20,代码来源:ExtendedTreeView.cs

示例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;
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:31,代码来源:Controller.cs

示例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
                };
            }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:15,代码来源:ClassTree.cs

示例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);
            }
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:13,代码来源:ClassTree.cs

示例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;
            });
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:67,代码来源:ClassTree.cs

示例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);
            }
        }
开发者ID:stegru,项目名称:ExceptionExplorer,代码行数:17,代码来源:ClassTree.cs


注:本文中的System.Windows.Forms.TreeNode.GetInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。