當前位置: 首頁>>代碼示例>>C#>>正文


C# TreeNodeCollection.CopyTo方法代碼示例

本文整理匯總了C#中System.Windows.Forms.TreeNodeCollection.CopyTo方法的典型用法代碼示例。如果您正苦於以下問題:C# TreeNodeCollection.CopyTo方法的具體用法?C# TreeNodeCollection.CopyTo怎麽用?C# TreeNodeCollection.CopyTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.TreeNodeCollection的用法示例。


在下文中一共展示了TreeNodeCollection.CopyTo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SortNodes

		public void SortNodes(TreeNodeCollection nodes, bool recursive)
		{
			if (!isSorted) {
				return;
			}
			TreeNode[] nodeArray = new TreeNode[nodes.Count];
			nodes.CopyTo(nodeArray, 0);
			Array.Sort(nodeArray, nodeSorter);
			nodes.Clear();
			nodes.AddRange(nodeArray);

			if (recursive) {
				foreach (TreeNode childNode in nodeArray) {
					SortNodes(childNode.Nodes, true);
				}
			}
		}
開發者ID:Bombadil77,項目名稱:SharpDevelop,代碼行數:17,代碼來源:ExtTreeView.cs

示例2: SetSelection

 public bool SetSelection(object value, TreeNodeCollection nodes)
 {
     TreeNode[] nodeArray;
     if (nodes == null)
     {
         nodeArray = new TreeNode[base.Nodes.Count];
         base.Nodes.CopyTo(nodeArray, 0);
     }
     else
     {
         nodeArray = new TreeNode[nodes.Count];
         nodes.CopyTo(nodeArray, 0);
     }
     int length = nodeArray.Length;
     if (length != 0)
     {
         for (int i = 0; i < length; i++)
         {
             if (((ObjectSelectorEditor.SelectorNode) nodeArray[i]).value == value)
             {
                 base.SelectedNode = nodeArray[i];
                 return true;
             }
             if ((nodeArray[i].Nodes != null) && (nodeArray[i].Nodes.Count != 0))
             {
                 nodeArray[i].Expand();
                 if (this.SetSelection(value, nodeArray[i].Nodes))
                 {
                     return true;
                 }
                 nodeArray[i].Collapse();
             }
         }
     }
     return false;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:36,代碼來源:ObjectSelectorEditor.cs

示例3: SortNodes

        /// <summary>Sorts the specified nodes.</summary>
        /// <param name="nodes">The nodes.</param>
        /// <param name="recursive">if set to <c>true</c> recursively sorts the children nodes.</param>
        protected void SortNodes(TreeNodeCollection nodes, bool recursive)
        {
            TreeNode[] array = new TreeNode[nodes.Count];
            nodes.CopyTo(array, 0);
            Array.Sort(array, base.TreeViewNodeSorter);
            nodes.Clear();
            nodes.AddRange(array);

            if (recursive)
            {
                foreach (TreeNode child in array) SortNodes(child.Nodes, true);
            }
        }
開發者ID:sagar1589,項目名稱:Delta.Cryptography,代碼行數:16,代碼來源:TreeViewEx.cs

示例4: SortNodes

 public void SortNodes(TreeNodeCollection nodes, bool recursive)
 {
     if (this.isSorted)
     {
         TreeNode[] dest = new TreeNode[nodes.Count];
         nodes.CopyTo(dest, 0);
         Array.Sort<TreeNode>(dest, this.nodeSorter);
         nodes.Clear();
         nodes.AddRange(dest);
         if (recursive)
         {
             foreach (TreeNode node in dest)
             {
                 this.SortNodes(node.Nodes, true);
             }
         }
     }
 }
開發者ID:vanloc0301,項目名稱:mychongchong,代碼行數:18,代碼來源:ExtTreeView.cs

示例5: RefreshNodes

 /// <summary>Refreshes the specified nodes.</summary>
 /// <param name="nodes">The nodes.</param>
 private void RefreshNodes(TreeNodeCollection nodes) 
 {
     TreeNode[] dest = new TreeNode[nodes.Count];
     nodes.CopyTo(dest, 0);
     nodes.Clear();
     nodes.AddRange(dest);
 }
開發者ID:sagar1589,項目名稱:Delta.Cryptography,代碼行數:9,代碼來源:TreeViewEx.cs


注:本文中的System.Windows.Forms.TreeNodeCollection.CopyTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。