[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class RouteValueDictionary : IDictionary, ICollection>, IEnumerable>, IEnumerable { // Fields private Dictionary _dictionary; // Methods public RouteValueDictionary() { this._dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); } public RouteValueDictionary(IDictionary dictionary) { this._dictionary = new Dictionary(dictionary, StringComparer.OrdinalIgnoreCase); } public RouteValueDictionary(object values) { this._dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); this.AddValues(values); } public void Add(string key, object value) { this._dictionary.Add(key, value); } private void AddValues(object values) { if (values != null) { foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(values)) { object obj2 = descriptor.GetValue(values); this.Add(descriptor.Name, obj2); } } } public void Clear() { this._dictionary.Clear(); } public bool ContainsKey(string key) { return this._dictionary.ContainsKey(key); } public bool ContainsValue(object value) { return this._dictionary.ContainsValue(value); } public Dictionary.Enumerator GetEnumerator() { return this._dictionary.GetEnumerator(); } public bool Remove(string key) { return this._dictionary.Remove(key); } void ICollection>.Add(KeyValuePair item) { this._dictionary.Add(item); } bool ICollection>.Contains(KeyValuePair item) { return this._dictionary.Contains(item); } void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) { this._dictionary.CopyTo(array, arrayIndex); } bool ICollection>.Remove(KeyValuePair item) { return this._dictionary.Remove(item); } IEnumerator> IEnumerable>.GetEnumerator() { return this.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } public bool TryGetValue(string key, out object value) { return this._dictionary.TryGetValue(key, out value); } // Properties public int Count { get { return this._dictionary.Count; } } public object this[string key] { get { object obj2; this.TryGetValue(key, out obj2); return obj2; } set { this._dictionary[key] = value; } } public Dictionary.KeyCollection Keys { get { return this._dictionary.Keys; } } bool ICollection>.IsReadOnly { get { return this._dictionary.IsReadOnly; } } ICollection IDictionary.Keys { get { return this._dictionary.Keys; } } ICollection IDictionary.Values { get { return this._dictionary.Values; } } public Dictionary.ValueCollection Values { get { return this._dictionary.Values; } } }