コード例 #1
0
ファイル: SortableList.cs プロジェクト: Alexanderse/romviewer
        /// <summary>
        /// ICloneable implementation.
        /// Idem <see cref="ArrayList">ArrayList</see>
        /// </summary>
        /// <returns>Cloned object.</returns>
        public object Clone()
        {
            SortableList Clone = new SortableList(_Comparer, _List.Capacity);

            Clone._List          = (ArrayList)_List.Clone();
            Clone._AddDuplicates = _AddDuplicates;
            Clone._IsSorted      = _IsSorted;
            Clone._KeepSorted    = _KeepSorted;
            return(Clone);
        }
コード例 #2
0
ファイル: SortableList.cs プロジェクト: Alexanderse/romviewer
        /// <summary>
        /// Object.Equals() override.
        /// </summary>
        /// <returns>true if object is equal to this, otherwise false.</returns>
        public override bool Equals(object O)
        {
            SortableList SL = (SortableList)O;

            if (SL.Count != Count)
            {
                return(false);
            }
            for (int i = 0; i < Count; i++)
            {
                if (!SL[i].Equals(this[i]))
                {
                    return(false);
                }
            }
            return(true);
        }