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


C# TreeView.visible方法代码示例

本文整理汇总了C#中System.Windows.Forms.TreeView.visible方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.visible方法的具体用法?C# TreeView.visible怎么用?C# TreeView.visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TreeView的用法示例。


在下文中一共展示了TreeView.visible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: showInTreeView

        public static void showInTreeView(this MethodMappings methodMappings, TreeView treeView, string filter, bool showSourceCodeSnippets, bool onlyShowSourceCodeLine)
        {
            treeView.parent().backColor("LightPink");
            treeView.visible(false);
            treeView.clear();
            var indexedMappings = methodMappings.indexedByKey(filter);
            if (onlyShowSourceCodeLine)
            {
                //do this so that we don't add more than one item per line
                var indexedByFileAndLine = new Dictionary<string, MethodMapping>();

                foreach(var item in indexedMappings)
                    foreach(var methodMapping in item.Value)
                        if (methodMapping.File.valid())
                        {
                            var key = "{0}_{1}".format(methodMapping.File, methodMapping.Start_Line);
                            indexedByFileAndLine.add(key, methodMapping);
                        }
                // now group then by the same text in the SourceCodeLine
                var indexedBySourceCodeLine =  new Dictionary<string, List<MethodMapping>>();
                foreach(var methodMapping in indexedByFileAndLine.Values)
                    indexedBySourceCodeLine.add(methodMapping.sourceCodeLine(), methodMapping);

                //Finally show then
                foreach(var item  in indexedBySourceCodeLine)
                {
                    var uniqueTextNode = treeView.add_Node(item.Key, item.Value,true);
                }
            }
            else
            {
                foreach(var item in indexedMappings)
                {
                    var keyNodeText = "{0}                       ({1})".format(item.Key, item.Value.size());
                    var keyNode= treeView.add_Node(keyNodeText, item.Value,true);
                }
                treeView.afterSelect<List<MethodMapping>>(
                    (mappings)=>{
                                    var keyNode = treeView.selected();
                                    keyNode.clear();
                                    foreach(var methodMapping in mappings)
                                    {
                                        var nodeText = (showSourceCodeSnippets)
                                            ? methodMapping.sourceCodeLine()
                                            : "{0} - {1}".format(methodMapping.INodeType,methodMapping.SourceCode);
                                        keyNode.add_Node(nodeText, methodMapping);
                                    }
                    });
            }
            treeView.parent().backColor("Control");
            treeView.visible(true);
        }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:52,代码来源:MethodMappings_ExtensionMethods_GUI.cs


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