/// <summary>
        /// 元の TreeElementCollections 内の要素のサブセットを表す TreeElementCollections を返します。</summary>
        ///
        ///    <param name="anIndex">
        ///    範囲が開始する位置の、0から始まる TreeElementCollection のインデックス番号。</param>
        ///    <param name="aCount">
        ///    範囲内の要素の数。</param>
        ///
        public TreeElementCollection GetRange(Int32 anIndex, Int32 aCount)
        {
            TreeElementCollection list = new TreeElementCollection(this.OwnerElement);

            list.AddRange(this._list.GetRange(anIndex, aCount));

            return(list);
        }
        /// <summary>
        /// コレクションの要素を TreeElementCollection 内の指定したインデックスの位置に挿入します。</summary>
        ///
        ///    <param name="anItem">
        ///    新しい要素が挿入される位置の 0 から始まるインデックス。</param>
        ///    <param name="someElements">
        ///    TreeElementCollection に要素を挿入する ICollection 。</param>
        ///
        internal void InsertRange(Int32 anItem, TreeElementCollection someElements)
        {
            foreach (TreeElement element in someElements)
            {
                element.SetParentElement(this.OwnerElement);
            }

            this._list.InsertRange(anItem, someElements);
        }
        /// <summary>
        /// </summary>
        ///
        internal void AddRangeSubElements(TreeElementCollection someElements)
        {
            if (someElements == null)
            {
                throw new ArgumentNullException("someElements");
            }

            foreach (TreeElement element in someElements)
            {
                this.AddSubElement(element);
            }
        }
Пример #4
0
        /// <summary>
        /// 要素のコレクションを子要素へ追加します。</summary>
        ///
        public void AddElements(TreeElementCollection someElements)
        {
            if (someElements == null)
            {
                throw new ArgumentNullException("someElements");
            }

            foreach (TreeElement element in someElements)
            {
                this.Add(element);
            }
        }
        /// <summary>
        /// TreeElementCollection のディープコピーを作成します。</summary>
        ///
        public Object Clone()
        {
            TreeElementCollection cloneElementCollection = new TreeElementCollection(( TreeElement )this.OwnerElement.Clone());

            foreach (TreeElement element in this._list)
            {
                cloneElementCollection.Add(( TreeElement )element.Clone());

                if (element.HasChild)
                {
                    cloneElementCollection.AddRange(( TreeElementCollection )element.ChildElements.Clone());
                }
            }

            return(cloneElementCollection);
        }
 // constructor
 #region ' + constructor ( TreeElementCollection )
 /// <summary>
 /// 新しい TreeElementCollectionsEnumerator のインスタンスを TreeElementCollection で初期化します。</summary>
 ///
 public TreeElementCollectionsEnumerator(TreeElementCollection aList)
 {
     this._list = aList;
 }
Пример #7
0
 // constructor
 #region ' + constructor ( TreeElementCollection )
 /// <summary>
 /// 新しい TreeElementEnumerator のインスタンスを TreeElementCollection で初期化します。</summary>
 ///
 public TreeElementEnumerator(TreeElementCollection aList)
 {
     _list = aList;
 }