Ejemplo n.º 1
0
 /// <summary>
 /// Indicates whether this and another instance are considered equivalent.
 /// </summary><returns>
 /// True if both instances share the same backing array, or if both backing arrays are absent; otherwise false.
 /// </returns>
 /// <param name="other">Another instance to compare against.</param>
 public bool Equals(ReadOnlyArray <T> other)
 {
     return(object.ReferenceEquals(this.array, other.array));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates an <see cref="Enumerator"/> for the array wrapped in the <see cref="ReadOnlyArray{T}"/> argument.
 /// </summary>
 public Enumerator(ReadOnlyArray <T> array) : this(array.Array)
 {
 }
Ejemplo n.º 3
0
 /// <inheritdoc cref="ArrayEnumeratorReadOnly{T}.ArrayEnumeratorReadOnly(int, ReadOnlyArray{T}, int)"/>
 public static ArrayEnumeratorReadOnly <T> CreateReadOnly <T>(int start, ReadOnlyArray <T> array, int length)
 {
     return(new ArrayEnumeratorReadOnly <T>(start, array, length));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a <see cref="ArrayEnumeratorReadOnly{T}"/> from a <see cref="ReadOnlyArray{T}"/>.
 /// </summary>
 /// <param name="array">Array to create enumerator for.</param>
 public ArrayEnumeratorReadOnly(ReadOnlyArray <T> array)
     : this(array.Source, 0, array.Length - 1)
 {
 }
Ejemplo n.º 5
0
        // ----

        /// <inheritdoc cref="ArrayEnumeratorReadOnly{T}.ArrayEnumeratorReadOnly(ReadOnlyArray{T})"/>
        public static ArrayEnumeratorReadOnly <T> CreateReadOnly <T>(ReadOnlyArray <T> array)
        {
            return(new ArrayEnumeratorReadOnly <T>(array));
        }