diff options
author | Marek Habersack <grendel@twistedcode.net> | 2011-04-01 13:53:11 +0400 |
---|---|---|
committer | Marek Habersack <grendel@twistedcode.net> | 2011-04-01 13:55:09 +0400 |
commit | c0c51c0791c3f03a9c134eb9cdf94b9ecc4e2fbe (patch) | |
tree | d7793909dbf99bd408ddee6bae49f9001b579c27 /mcs/class/Microsoft.Web.Infrastructure | |
parent | 0a6c794f1e597a40d2f10707522e272ed6b1a2c5 (diff) |
[mvc3] Part of fix for bug #683339. Override more NameValueCollection methods.
Without those overrides, merging collections in System.Web.HttpParamsCollection fails.
Diffstat (limited to 'mcs/class/Microsoft.Web.Infrastructure')
-rw-r--r-- | mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs b/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs index c3d9122e247..c8223d7dd49 100644 --- a/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs +++ b/mcs/class/Microsoft.Web.Infrastructure/Microsoft.Web.Infrastructure.DynamicValidationHelper/LazyWebROCollection.cs @@ -25,6 +25,7 @@ using System; using System.Collections; using System.Collections.Specialized; +using System.Runtime.Serialization; using System.Web; using System.Web.Util; @@ -44,14 +45,41 @@ namespace Microsoft.Web.Infrastructure.DynamicValidationHelper this.wrapped = wrapped; } - public string this [int index] { + public new string this [int index] { get { return Get (index); } } - public string this [string name] { + public new string this [string name] { get { return Get (name); } set{ Set (name,value); } } + + public override string[] AllKeys { + get { return wrapped.AllKeys; } + } + + public override int Count { + get { return wrapped.Count; } + } + + public override NameObjectCollectionBase.KeysCollection Keys { + get { return wrapped.Keys; } + } + + public new void Add (NameValueCollection c) + { + wrapped.Add (c); + } + + public override void Add (string name, string val) + { + wrapped.Add (name, val); + } + + public override void Clear () + { + wrapped.Clear (); + } public override string Get (string name) { @@ -63,6 +91,11 @@ namespace Microsoft.Web.Infrastructure.DynamicValidationHelper return Validate (wrapped.GetKey (index), wrapped.Get (index)); } + public override void GetObjectData (SerializationInfo info, StreamingContext context) + { + wrapped.GetObjectData (info, context); + } + public override IEnumerator GetEnumerator () { return wrapped.GetEnumerator (); @@ -83,6 +116,16 @@ namespace Microsoft.Web.Infrastructure.DynamicValidationHelper return wrapped.GetValues (name); } + public override void OnDeserialization (object sender) + { + wrapped.OnDeserialization (sender); + } + + public override void Set (string name, string value) + { + wrapped.Set (name, value); + } + string Validate (string key, string value) { if (String.IsNullOrEmpty (value)) |