Esempio n. 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="collection"></param>
 public UndoBlockCollection(UndoBlockCollection collection)
 {
     AddRange(collection);
 }
Esempio n. 2
0
 // Operations (type-safe ICloneable)
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public UndoBlockCollection Clone()
 {
     var tc = new UndoBlockCollection();
     tc.AddRange(this);
     tc.Capacity = m_array.Length;
     tc.m_version = m_version;
     return tc;
 }
Esempio n. 3
0
 // Construction
 public Enumerator(UndoBlockCollection tc)
 {
     m_collection = tc;
     m_index = - 1;
     m_version = tc.m_version;
 }
Esempio n. 4
0
        // Public helpers (just to mimic some nice features of ArrayList)
        /// <summary>
        /// 
        /// </summary>
        /// <param name="collection"></param>
        public void AddRange(UndoBlockCollection collection)
        {
            // for (int i=0; i < collection.Count; ++i) Add(collection[i]);

            ++m_version;

            Capacity += collection.Count;
            Array.Copy(collection.m_array, 0, m_array, m_count, collection.m_count);
            m_count += collection.Count;
        }