Esempio n. 1
0
        /// <summary>
        /// Creates a shallow copy of the <see cref="LinkedStack"/>.
        /// </summary>
        /// <returns>A shallow copy of the <see cref="LinkedStack"/>.</returns>
        public LinkedStack Clone()
        {
            var clone = new LinkedStack();

            var array = new object[Count];

            CopyTo(array, 0);

            for (var i = array.Length - 1; i >= 0; i--)
            {
                clone.Push(array[i]);
            }

            return(clone);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LinkedArrayEnumerator"/>.
 /// </summary>
 /// <param name="stack">The <see cref="LinkedStack"/>.</param>
 public LinkedArrayEnumerator(LinkedStack stack)
 {
     _stack   = stack;
     _current = _stack._current;
     Current  = null;
 }