Skip to content

Commit

Permalink
* StringCollection.cs: Renamed internal variable to make serialization
Browse files Browse the repository at this point in the history
	  compatible with MS.NET.

svn path=/trunk/mcs/; revision=27962
  • Loading branch information
slluis committed May 24, 2004
1 parent 3a59ec0 commit 013f013
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
5 changes: 5 additions & 0 deletions mcs/class/System/System.Collections.Specialized/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2004-05-24 Lluis Sanchez Gual <lluis@ximian.com>

* StringCollection.cs: Renamed internal variable to make serialization
compatible with MS.NET.

2004-03-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* ListDictionary.cs: mark ListEntry as serializable. Thanks to Jan
Expand Down
30 changes: 15 additions & 15 deletions mcs/class/System/System.Collections.Specialized/StringCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ namespace System.Collections.Specialized {

[Serializable]
public class StringCollection : IList {
ArrayList strings = new ArrayList ();
ArrayList data = new ArrayList ();

public string this [int index] {
get { return (string)strings [index]; }
set { strings [index] = value; }
get { return (string)data [index]; }
set { data [index] = value; }
}

public int Count {
get { return strings.Count; }
get { return data.Count; }
}

bool IList.IsReadOnly {
Expand All @@ -36,38 +36,38 @@ bool IList.IsFixedSize {


public int Add (string value) {
return strings.Add (value);
return data.Add (value);
}

public void AddRange (string [] value) {
if (value == null)
throw new ArgumentNullException ("value");

strings.AddRange (value);
data.AddRange (value);
}

public void Clear () {
strings.Clear ();
data.Clear ();
}

public bool Contains (string value) {
return strings.Contains (value);
return data.Contains (value);
}

public void CopyTo (string [] array, int index) {
strings.CopyTo (array, index);
data.CopyTo (array, index);
}

public StringEnumerator GetEnumerator () {
return new StringEnumerator (this);
}

public int IndexOf (string value) {
return strings.IndexOf (value);
return data.IndexOf (value);
}

public void Insert(int index, string value) {
strings.Insert (index, value);
data.Insert (index, value);
}

public bool IsReadOnly {
Expand All @@ -79,11 +79,11 @@ public bool IsSynchronized {
}

public void Remove (string value) {
strings.Remove (value);
data.Remove (value);
}

public void RemoveAt (int index) {
strings.RemoveAt (index);
data.RemoveAt (index);
}

public object SyncRoot {
Expand Down Expand Up @@ -116,11 +116,11 @@ void IList.Remove (object value) {
}

void ICollection.CopyTo (Array array, int index) {
strings.CopyTo (array, index);
data.CopyTo (array, index);
}

IEnumerator IEnumerable.GetEnumerator () {
return strings.GetEnumerator ();
return data.GetEnumerator ();
}
}
}

0 comments on commit 013f013

Please sign in to comment.