5 // John Barnette (jbarn@httcb.net)
6 // Sean MacIsaac (macisaac@ximian.com)
7 // Ben Maurer (bmaurer@users.sourceforge.net)
10 // Copyright (C) 2001 John Barnette
11 // (C) Ximian, Inc. http://www.ximian.com
14 namespace System.Collections.Specialized {
17 public class StringCollection : IList {
18 ArrayList strings = new ArrayList ();
20 public string this [int index] {
21 get { return (string)strings [index]; }
22 set { strings [index] = value; }
26 get { return strings.Count; }
29 bool IList.IsReadOnly {
33 bool IList.IsFixedSize {
38 public int Add (string value) {
39 return strings.Add (value);
42 public void AddRange (string [] value) {
44 throw new ArgumentNullException ("value");
46 strings.AddRange (value);
49 public void Clear () {
53 public bool Contains (string value) {
54 return strings.Contains (value);
57 public void CopyTo (string [] array, int index) {
58 strings.CopyTo (array, index);
61 public StringEnumerator GetEnumerator () {
62 return new StringEnumerator (this);
65 public int IndexOf (string value) {
66 return strings.IndexOf (value);
69 public void Insert(int index, string value) {
70 strings.Insert (index, value);
73 public bool IsReadOnly {
77 public bool IsSynchronized {
81 public void Remove (string value) {
82 strings.Remove (value);
85 public void RemoveAt (int index) {
86 strings.RemoveAt (index);
89 public object SyncRoot {
93 object IList.this [int index] {
94 get { return this [index]; }
95 set { this [index] = (string)value; }
98 int IList.Add (object value) {
99 return Add ((string)value);
102 bool IList.Contains (object value) {
103 return Contains ((string) value);
106 int IList.IndexOf (object value) {
107 return IndexOf ((string)value);
110 void IList.Insert (int index, object value) {
111 Insert (index, (string)value);
114 void IList.Remove (object value) {
115 Remove ((string)value);
118 void ICollection.CopyTo (Array array, int index) {
119 strings.CopyTo (array, index);
122 IEnumerator IEnumerable.GetEnumerator () {
123 return strings.GetEnumerator ();