2 using System.Collections;
3 using System.Collections.Generic;
22 public void Add(T item) =>
throw new InvalidOperationException();
24 public void Clear() =>
throw new InvalidOperationException();
26 public bool Remove(T item) =>
throw new InvalidOperationException();
30 public void CopyTo(T[] array,
int arrayIndex)
32 void performCopy(IEnumerable<T> enumerable)
34 if (enumerable is ICollection<T> collection)
36 collection.CopyTo(array, arrayIndex);
37 arrayIndex += collection.Count;
41 foreach (var item
in enumerable)
43 array[arrayIndex] = item;
55 foreach (T item
in enumerableA) { yield
return item; }
56 foreach (T item
in enumerableB) { yield
return item; }
64 public ListConcat(IEnumerable<T> a, IEnumerable<T> b) : base(a, b) { }
71 int index = listA.IndexOf(item);
72 if (index >= 0) {
return index; }
79 if (
object.Equals(item, a)) {
return aCount; }
86 int index = listB.IndexOf(item);
87 if (index >= 0) {
return index + aCount; }
93 if (
object.Equals(item, b)) {
return aCount; }
103 throw new InvalidOperationException();
108 throw new InvalidOperationException();
111 public T
this[
int index]
120 throw new InvalidOperationException();
IEnumerator< T > GetEnumerator()
CollectionConcat(IEnumerable< T > a, IEnumerable< T > b)
readonly IEnumerable< T > enumerableA
void CopyTo(T[] array, int arrayIndex)
readonly IEnumerable< T > enumerableB
ListConcat(IEnumerable< T > a, IEnumerable< T > b)
void Insert(int index, T item)