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


C# TreeNodeCollection.Cast方法代码示例

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


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

示例1: ClearProjectNodes

 private void ClearProjectNodes(TreeNodeCollection nodes)
 {
     var treeNodes = nodes.Cast<TreeNode>().ToArray();
     foreach (var treeNode in treeNodes)
     {
         treeNode.Tag = null;
         _projects.Nodes.Remove(treeNode);
     }
 }
开发者ID:jonca,项目名称:SirenOfShame,代码行数:9,代码来源:ConfigureTeamCity.cs

示例2: RefreshNodeColors

        void RefreshNodeColors(TreeNodeCollection nodes, bool recursive)
        {
            foreach (var node in nodes.Cast<GenericNode>())
            {
                if (recursive) RefreshNodeColors(node.Nodes, recursive);

                node.BackColor = this.BackColor;
                node.ForeColor = this.ForeColor;
                node.ForeColorRequest = this.ForeColor;
            }
        }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:11,代码来源:ProjectTreeView.cs

示例3: ProcessPath

 public void ProcessPath(IEnumerable<String> path, TreeNodeCollection nodes)
 {
     if (!path.Any())
         return;
     var node = nodes.Cast<TreeNode>().FirstOrDefault(n => n.Text == path.First());
     if (node == null)
     {
         node = new TreeNode(text: path.First());
         nodes.Add(node);
     }
     ProcessPath(path.Skip(1), node.Nodes);
 }
开发者ID:ARMmaster17,项目名称:OsDevKit,代码行数:12,代码来源:ProjectView.cs

示例4: ResetAllNodeHighlighting

        private void ResetAllNodeHighlighting(TreeNodeCollection nodes)
        {
            labelNumFound.Text = "";

            foreach (var node in nodes.Cast<TreeNode>())
            {
                HighlightNode(node, false);
                ResetAllNodeHighlighting(node.Nodes);
            }
        }
开发者ID:Estimable,项目名称:gitextensions,代码行数:10,代码来源:SettingsTreeViewUserControl.cs

示例5: GetCompoundExpression

 private Expression GetCompoundExpression(string quantifier, TreeNodeCollection nodes)
 {
     if (nodes == null || nodes.Count < 1)
         return Expression.Constant(true);
     Expression result = null;
     var first = true;
     foreach (var subCondition in nodes.Cast<TreeNode>().Select(GetExpression))
     {
         result = first ? subCondition : Expression.MakeBinary(ExpressionType.AndAlso, result, subCondition);
         first = false;
     }
     return result;
 }
开发者ID:dogbiscuituk,项目名称:TagScanner32767,代码行数:13,代码来源:FilterController.cs

示例6: UpdateChildTreeNodes

    private void UpdateChildTreeNodes(TreeNodeCollection collection, IEnumerable<ISymbol> symbols) {
      foreach (ISymbol symbol in symbols) {
        if (symbol is ProgramRootSymbol) continue;
        if (symbol is Defun) continue;

        TreeNode node = collection.Cast<TreeNode>().Where(n => n.Tag == symbol).FirstOrDefault();
        if (node == null) {
          node = new TreeNode();
          node.Tag = symbol;
          collection.Add(node);
        }
        node.Checked = symbol.Enabled;
        node.Text = symbol.Name;

        var groupSymbol = symbol as GroupSymbol;
        if (groupSymbol != null) UpdateChildTreeNodes(node.Nodes, groupSymbol.Symbols);
      }
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:18,代码来源:SymbolicExpressionGrammarEditorView.cs

示例7: HideUnmarkedNodes

        private bool HideUnmarkedNodes(TreeNodeCollection nodes)
        {
            bool hasMarks = false;
            var nodess = nodes.Cast<CustomTreeNode>().ToArray();
            foreach (TreeNode tnode in nodess)
            {
                if (tnode == null)
                {
                    continue;
                }

                CustomTreeNode node = (CustomTreeNode)tnode;
                if (!string.IsNullOrEmpty(node.Tags))
                {
                    hasMarks = true;
                    continue;
                }

                if (node.Nodes.Count > 0)
                {
                    var hasChildMarks = HideUnmarkedNodes(node.Nodes);
                    if (hasChildMarks)
                    {
                        hasMarks = true;
                    }
                    else
                    {
                        node.Remove();
                    }
                }

                if (node.Nodes.Count == 0 && string.IsNullOrEmpty(node.Tags))
                {
                    node.Remove();
                }
            }

            return hasMarks;
        }
开发者ID:hxhlb,项目名称:jsparser,代码行数:39,代码来源:NavigationTreeView.cs

示例8: FindChildlessNode

 private static TreeNode FindChildlessNode(TreeNodeCollection nodes)
 {
     return nodes.Cast<TreeNode>().FirstOrDefault(node => node.Nodes.Count == 0);
 }
开发者ID:nnyamhon,项目名称:shuttle-esb,代码行数:4,代码来源:QueueHierarchyView.cs

示例9: nameAllNodes

 private void nameAllNodes(TreeNodeCollection Nodes)
 {
     List<TreeNode> allNodes = Nodes.Cast<TreeNode>().ToList();
     //flatten tree of nodes into list.
     for (int i = 0; i < allNodes.Count(); i++)
     {
         allNodes[i].Name = i.ToString();
         allNodes.AddRange(allNodes[i].Nodes.Cast<TreeNode>());
     }
 }
开发者ID:ME3Explorer,项目名称:ME3Explorer,代码行数:10,代码来源:FaceFXAnimSetEditor.cs


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