mscorlib(4.0.0.0) API with additions
StringCollection.cs
2 {
6  {
7  private ArrayList data = new ArrayList();
8 
15  public string this[int index]
16  {
17  get
18  {
19  return (string)data[index];
20  }
21  set
22  {
23  data[index] = value;
24  }
25  }
26 
29  public int Count => data.Count;
30 
34  bool IList.IsReadOnly
35  {
36  get
37  {
38  return false;
39  }
40  }
41 
45  bool IList.IsFixedSize
46  {
47  get
48  {
49  return false;
50  }
51  }
52 
55  public bool IsReadOnly => false;
56 
59  public bool IsSynchronized => false;
60 
63  public object SyncRoot => data.SyncRoot;
64 
71  object IList.this[int index]
72  {
73  get
74  {
75  return this[index];
76  }
77  set
78  {
79  this[index] = (string)value;
80  }
81  }
82 
86  public int Add(string value)
87  {
88  return data.Add(value);
89  }
90 
95  public void AddRange(string[] value)
96  {
97  if (value == null)
98  {
99  throw new ArgumentNullException("value");
100  }
101  data.AddRange(value);
102  }
103 
105  public void Clear()
106  {
107  data.Clear();
108  }
109 
114  public bool Contains(string value)
115  {
116  return data.Contains(value);
117  }
118 
129  public void CopyTo(string[] array, int index)
130  {
131  data.CopyTo(array, index);
132  }
133 
137  {
138  return new StringEnumerator(this);
139  }
140 
144  public int IndexOf(string value)
145  {
146  return data.IndexOf(value);
147  }
148 
155  public void Insert(int index, string value)
156  {
157  data.Insert(index, value);
158  }
159 
162  public void Remove(string value)
163  {
164  data.Remove(value);
165  }
166 
172  public void RemoveAt(int index)
173  {
174  data.RemoveAt(index);
175  }
176 
181  int IList.Add(object value)
182  {
183  return Add((string)value);
184  }
185 
190  bool IList.Contains(object value)
191  {
192  return Contains((string)value);
193  }
194 
198  int IList.IndexOf(object value)
199  {
200  return IndexOf((string)value);
201  }
202 
210  void IList.Insert(int index, object value)
211  {
212  Insert(index, (string)value);
213  }
214 
218  void IList.Remove(object value)
219  {
220  Remove((string)value);
221  }
222 
233  void ICollection.CopyTo(Array array, int index)
234  {
235  data.CopyTo(array, index);
236  }
237 
240  IEnumerator IEnumerable.GetEnumerator()
241  {
242  return data.GetEnumerator();
243  }
244  }
245 }
int Add(string value)
Adds a string to the end of the T:System.Collections.Specialized.StringCollection.
void Remove(string value)
Removes the first occurrence of a specific string from the T:System.Collections.Specialized....
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Represents a non-generic collection of objects that can be individually accessed by index.
Definition: IList.cs:8
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.IList is read-only.
Definition: IList.cs:30
Supports a simple iteration over a T:System.Collections.Specialized.StringCollection.
void RemoveAt(int index)
Removes the string at the specified index of the T:System.Collections.Specialized....
void Clear()
Removes all the strings from the T:System.Collections.Specialized.StringCollection.
bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.Specialized.StringCollection is sy...
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.IList has a fixed size.
Definition: IList.cs:40
Represents a collection of strings.
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
Definition: IEnumerable.cs:9
void AddRange(string[] value)
Copies the elements of a string array to the end of the T:System.Collections.Specialized....
StringEnumerator GetEnumerator()
Returns a T:System.Collections.Specialized.StringEnumerator that iterates through the T:System....
void Insert(int index, string value)
Inserts a string into the T:System.Collections.Specialized.StringCollection at the specified index.
int Add(object value)
Adds an item to the T:System.Collections.IList.
int IndexOf(string value)
Searches for the specified string and returns the zero-based index of the first occurrence within the...
void CopyTo(string[] array, int index)
Copies the entire T:System.Collections.Specialized.StringCollection values to a one-dimensional array...
int Count
Gets the number of strings contained in the T:System.Collections.Specialized.StringCollection.
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
Specifies that the class can be serialized.
bool Contains(object value)
Determines whether the T:System.Collections.IList contains a specific value.
Defines size, enumerators, and synchronization methods for all nongeneric collections.
Definition: ICollection.cs:8
bool Contains(string value)
Determines whether the specified string is in the T:System.Collections.Specialized....
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
Definition: ArrayList.cs:14