You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/11/16 23:20:24 UTC

svn commit: r345139 - /struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs

Author: husted
Date: Wed Nov 16 14:19:49 2005
New Revision: 345139

URL: http://svn.apache.org/viewcvs?rev=345139&view=rev
Log:
WQD-64
* Rework KeyValueList so that it can be a proxy for a generic IList of IKeyValue objects.

Modified:
    struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs

Modified: struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs?rev=345139&r1=345138&r2=345139&view=diff
==============================================================================
--- struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs (original)
+++ struts/sandbox/trunk/overdrive/Nexus/Core/KeyValueList.cs Wed Nov 16 14:19:49 2005
@@ -6,13 +6,22 @@
 	/// <summary>
 	/// Implement IKeyValueList.
 	/// </summary>
-	public class KeyValueList : ArrayList, IKeyValueList
+	public class KeyValueList : IKeyValueList
 	{
+
+		private IList list;
+
 		/// <summary>
 		/// Construct instance without parameters.
 		/// </summary>
 		public KeyValueList()
 		{
+			list = new ArrayList();
+		}
+
+		public KeyValueList(IList _list)
+		{
+			list = _list;
 		}
 
 		/// <summary>
@@ -24,7 +33,7 @@
 			{
 				foreach (object o in value)
 				{
-					this.Add(o);
+					list.Add(o);
 				}
 			}
 		}
@@ -32,11 +41,87 @@
 		public string ValueFor(string key)
 		{
 			if ((key == null) || (key.Equals(String.Empty))) return key;
-			foreach (IKeyValue kv in this)
+			foreach (IKeyValue kv in list)
 			{
 				if (key.Equals(kv.Key)) return kv.Value as string;
 			}
 			return null;
+		}
+
+		public int Add(object value)
+		{
+			return list.Add(value);
+		}
+
+		public bool Contains(object value)
+		{
+			return list.Contains(value);
+		}
+
+		public void Clear()
+		{
+			list.Clear();
+		}
+
+		public int IndexOf(object value)
+		{
+			return list.IndexOf(value);
+		}
+
+		public void Insert(int index, object value)
+		{
+			list.Insert(index,value);
+		}
+
+		public void Remove(object value)
+		{
+			list.Remove(value);
+		}
+
+		public void RemoveAt(int index)
+		{
+			list.RemoveAt(index);
+		}
+
+		public bool IsReadOnly
+		{
+			get { return list.IsReadOnly; }
+		}
+
+		public bool IsFixedSize
+		{
+			get { return list.IsFixedSize; }
+		}
+
+		public object this[int index]
+		{
+			get { return list[index]; }
+			set { list[index] = value; }
+		}
+
+		public void CopyTo(Array array, int index)
+		{
+			this.CopyTo(array,index);
+		}
+
+		public int Count
+		{
+			get { return list.Count; }
+		}
+
+		public object SyncRoot
+		{
+			get { return list.SyncRoot; }
+		}
+
+		public bool IsSynchronized
+		{
+			get { return list.IsSynchronized; }
+		}
+
+		public IEnumerator GetEnumerator()
+		{
+			return list.GetEnumerator();
 		}
 	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org