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


C# TreeNodeCollection.Remove方法代码示例

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


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

示例1: RemoveCheckedNodes

 static void RemoveCheckedNodes(TreeNodeCollection nodes)
 {
     List<TreeNode> checkedNodes = new List<TreeNode>();
     foreach (TreeNode node in nodes)
     {
         if (node.Tag == null && node.FirstNode == null)
         {
             checkedNodes.Add(node);
         }
         else
         {
             RemoveCheckedNodes(node.Nodes);
         }
     }
     foreach (TreeNode checkedNode in checkedNodes)
     {
         nodes.Remove(checkedNode);
     }
 }
开发者ID:mmepinkerton,项目名称:evemarketscanner,代码行数:19,代码来源:MarketTreeView.cs

示例2: verifyReflexivesRecursive

 private TreeNodeCollection verifyReflexivesRecursive(BinaryReader br, TreeNodeCollection tnc, int baseOffset)
 {
     for (int i = 0; i < tnc.Count; i++)
     {
         TreeNode tn = tnc[i];
         string[] offsets = tn.Name.Split('\\');
         if (tn.Nodes.Count > 0)
         {
             br.BaseStream.Position = baseOffset + int.Parse(offsets[offsets.Length - 1]);
             int count = br.ReadInt32();
             int offset = br.ReadInt32() - meta.magic - meta.offset;
             if (count == 0)
             {
                 tnc.Remove(tn);
                 i--;
                 continue;
             }
             else
             {
                 tagInfo ti = (tagInfo)tn.Tag;
                 ti.chunkCount = count;
                 ti.offset = offset;
                 tn.Text += " [" + (ti.chunkSelection + 1).ToString() + "/" + ti.chunkCount.ToString() + "]";
                 TreeNodeCollection tnt = verifyReflexivesRecursive(br, tn.Nodes, offset);
                 TreeNode[] tna = new TreeNode[tnt.Count];
                 tnt.CopyTo(tna, 0);
                 tn.Nodes.Clear();
                 tn.Nodes.AddRange(tna);
             }
         }
     }
     return tnc;
 }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:33,代码来源:RestoreSelections.cs

示例3: SwapTreeNodes

 private void SwapTreeNodes(TreeNodeCollection collection, int a, int b)
 {
     var aNode = collection[a];
     var bNode = collection[b];
     collection.Remove(aNode);
     collection.Remove(bNode);
     collection.Insert(a, bNode);
     collection.Insert(b, aNode);
 }
开发者ID:HellUnit,项目名称:OxidePatcher,代码行数:9,代码来源:PatcherForm.cs

示例4: RemoveFromTree

 /// <summary>
 /// Remove shape from the tree node collection
 /// </summary>
 /// <param name="shape"></param>
 /// <param name="treeNodes"></param>
 /// <returns>true if removed</returns>
 private static bool RemoveFromTree(DrawingShape shape, TreeNodeCollection treeNodes)
 {
     foreach (TreeNode node in treeNodes)
     {
         if (node.Tag == shape)
         {
             treeNodes.Remove(node);
             return true;
         }
         if (node.Nodes.Count > 0 && RemoveFromTree(shape, node.Nodes))
             return true;
     }
     return false;
 } 
开发者ID:QuocHuy7a10,项目名称:Arianrhod,代码行数:20,代码来源:D2DShapesControlWithButtons.cs

示例5: MoveNode

 private void MoveNode(int index, TreeNodeCollection nodes, TreeNode targetNode)
 {
     nodes.Remove(targetNode);
     nodes.Insert(index, targetNode);
     OnMovedNode(targetNode);
 }
开发者ID:omega227,项目名称:DeanCC,代码行数:6,代码来源:PatrolPatternTreeView.cs

示例6: RemoveOld

 private void RemoveOld(TreeNodeCollection aNodes, HashSet<LogEntry> aEntries)
 {
     List<TreeNode> deleteList = new List<TreeNode>();
     foreach (TreeNode node in aNodes)
     {
         LogEntry entry = node.Tag as LogEntry;
         if (entry != null && !aEntries.Contains(entry))
         {
             deleteList.Add(node);
         }
         else if (entry == null)
         {
             RemoveOld(node.Nodes, aEntries);
             if (node.Nodes.Count == 0)
             {
                 deleteList.Add(node);
             }
         }
     }
     foreach (TreeNode node in deleteList)
     {
         aNodes.Remove(node);
     }
 }
开发者ID:tvandijck,项目名称:flysight,代码行数:24,代码来源:JumpForm.cs

示例7: RemoveItem

        private void RemoveItem(TreeNodeCollection lst, BaseObject obj)
        {
            LoadTreeNodeChilds();

            if (obj is DataBase.Category)
            {
                DataBase.Category c = (DataBase.Category) obj;

                for (int i = 0; i < lst.Count; i++)
                {
                    if (lst[i] is TreeNodeCategory)
                    {
                        TreeNodeCategory cc = (TreeNodeCategory) lst[i];

                        if (cc.cat == c)
                        {
                            lst.RemoveAt(i);
                            return;
                        }
                    }
                }
            }
            else if (obj is DataBase.Box)
            {
                DataBase.Box b = (DataBase.Box) obj;

                for (int i = 0; i < lst.Count; i++)
                {
                    if (lst[i] is TreeNodeBox)
                    {
                        TreeNodeBox bb = (TreeNodeBox) lst[i];

                        if (bb.InternalBox == b)
                        {
                            lst.Remove(bb);
                            return;
                        }
                    }
                }
            }
        }
开发者ID:drme,项目名称:disks-db,代码行数:41,代码来源:TreeNodeCategory.cs

示例8: BindNode

        private void BindNode(ISimulatorNode simNode, TreeNode node, TreeNodeCollection parent)
        {
            node.Text = simNode.DisplayName;
            node.Tag = simNode;

            var menu = new ContextMenu();

            foreach (var nodeAction in simNode.Actions)
            {
                var action = new MenuItem(nodeAction.DisplayName);
                action.Click += new EventHandler(
                    delegate(Object o, EventArgs a)
                    {
                        nodeAction.Invoke();
                    }
                );
                menu.MenuItems.Add(action);
            }

            if (simNode.Actions.Any())
            {
                menu.MenuItems.Add("-");
            }

            foreach (var factory in simNode.Children)
            {
                var action = new MenuItem(factory.DisplayName);
                action.Click += new EventHandler(
                    delegate(Object o, EventArgs a)
                    {
                        var callbacks = new TreeNodeCallbacks(this);
                        var child = factory.Create(callbacks);
                        if (child != null)
                        {
                            this.BindNode(child, callbacks.node, node.Nodes);
                        }
                    }
                );
                menu.MenuItems.Add(action);
            }

            if (simNode.Children.Any())
            {
                menu.MenuItems.Add("-");
            }

            var item = new MenuItem("Remove");
            item.Click += new EventHandler(
                delegate(Object o, EventArgs a)
                {
                    ShutdownFrom(node);
                    parent.Remove(node);
                }
            );

            menu.MenuItems.Add(item);
            node.ContextMenu = menu;
            parent.Add(node);
        }
开发者ID:automatak,项目名称:dnp3-simulator,代码行数:59,代码来源:SimulatorForm.cs

示例9: RemoveNoneExistingNodes

        /// <summary>
        ///     Removes all nodes that don't belong to anything anymore from a tree view.
        /// </summary>
        /// <param name="nodes">Collection of nodes to look through.</param>
        /// <returns>True if any nodes were removed.</returns>
        private bool RemoveNoneExistingNodes(TreeNodeCollection nodes)
        {
            foreach (TreeNode subnode in nodes)
            {
                if (RemoveNoneExistingNodes(subnode.Nodes) == true)
                {
                    return true;
                }

                if (subnode.Tag != null &&
                    m_simulator.ArbitratorStates.Contains(subnode.Tag) == false &&
                    m_simulator.ClientStates.Contains(subnode.Tag) == false)
                {
                    nodes.Remove(subnode);
                    return true;
                }
            }

            return false;
        }
开发者ID:HampsterEater,项目名称:Dynammo,代码行数:25,代码来源:SimulatorForm.cs

示例10: RemoveByKey

 private void RemoveByKey(TreeNodeCollection nodes, string key)
 {
     if (TestList.InvokeRequired == true)
     {
         this.Invoke(new RemoveNodeByKeyCB(RemoveByKey), new object[] { nodes, key });
         return;
     }
     TreeNode node = FindByKey( nodes, key );
     if( node != null )
     nodes.Remove( node );
 }
开发者ID:powerumc,项目名称:vutpp,代码行数:11,代码来源:UnitTestBrowser.cs

示例11: Remove

 private void Remove(TreeNodeCollection nodes, TreeNode node)
 {
     if (TestList.InvokeRequired == true)
     {
         this.Invoke(new RemoveNodeCB(Remove), new object[] { nodes, node });
         return;
     }
     nodes.Remove(node);
 }
开发者ID:powerumc,项目名称:vutpp,代码行数:9,代码来源:UnitTestBrowser.cs


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