Beispiel #1
0
        private void build( TreeNodeCollection from , TreeNodeCollection to , TreeNode parent )
        {
            TreeNodeCollection childNodes = from.SearchByParentId( parent.Id ) ;

            foreach( TreeNode n in childNodes )
            {
                to.Add(n);
                this.build( from , n.ChildNodes , n ) ;
            }
        }
Beispiel #2
0
        /// <summary>
        /// ��ӽڵ�
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public int Add(  TreeNode value )
        {
            value.SetParentNode( this._ParentNode ) ;

            if( _Owner != null )
            {
                _Owner.OnTreeNodeCreated( value ) ;
            }

            return( List.Add( value ) );
        }
Beispiel #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="parent"></param>
 public TreeNodeCollection( TreeNode parent )
 {
     _ParentNode = parent;
 }
Beispiel #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="parent"></param>
 public TreeNodeCollection( TreeView owner , TreeNode parent )
 {
     _Owner = owner ;
     _ParentNode = parent;
 }
Beispiel #5
0
 /// <summary>
 /// ɾ���ڵ�
 /// </summary>
 /// <param name="value"></param>
 public void Remove(  TreeNode value )
 {
     List.Remove( value );
 }
Beispiel #6
0
        /// <summary>
        /// ����ڵ�
        /// </summary>
        /// <param name="index"></param>
        /// <param name="value"></param>
        public void Insert( int index,  TreeNode value )
        {
            value.SetParentNode( this._ParentNode ) ;

            if( _Owner != null )
            {
                _Owner.OnTreeNodeCreated( value ) ;
            }

            List.Insert( index, value );
        }
Beispiel #7
0
 /// <summary>
 /// ��ȡ�ڵ�����
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public int IndexOf(  TreeNode value )
 {
     return( List.IndexOf( value ) );
 }
Beispiel #8
0
 /// <summary>
 /// �Ƿ�����ڵ�
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public bool Contains(  TreeNode value )
 {
     return( List.Contains( value ) );
 }