Esempio n. 1
0
        /// <summary>
        /// <para>Get a mutable copy of the list</para>
        /// <para>Will trigger a copy all operation if immutable() has been called since creation or the last call to mutable().</para>
        /// </summary>
        /// <returns>Mutable copy of the list</returns>
        public ReadOnlyList <T> mutable()
        {
            if (myList.IsReadOnly)
            {
                myList = ReadOnlyList <T> .create_Writable(myList);
            }

            return(myList);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes with a list with the specified capacity.
 /// </summary>
 /// <param name="initialCapacity"></param>
 public ListSnapshots(int initialCapacity)
 {
     myList = ReadOnlyList <T> .create_Writable(initialCapacity);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes with a list with elements copied from the collection.
 /// </summary>
 /// <param name="collection">To copy elements from</param>
 public ListSnapshots(IEnumerable <T> collection)
 {
     myList = ReadOnlyList <T> .create_Writable(collection);
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes with a list with the default capacity.
 /// </summary>
 public ListSnapshots()
 {
     myList = ReadOnlyList <T> .create_Writable();
 }