Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Routing / RouteValueDictionary.cs / 1305376 / RouteValueDictionary.cs
namespace System.Web.Routing {
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
[TypeForwardedFrom("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
public class RouteValueDictionary : IDictionary {
private Dictionary _dictionary;
public RouteValueDictionary() {
_dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
public RouteValueDictionary(object values) {
_dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase);
AddValues(values);
}
public RouteValueDictionary(IDictionary dictionary) {
_dictionary = new Dictionary(dictionary, StringComparer.OrdinalIgnoreCase);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public int Count {
get {
return _dictionary.Count;
}
}
public Dictionary.KeyCollection Keys {
get {
return _dictionary.Keys;
}
}
public Dictionary.ValueCollection Values {
get {
return _dictionary.Values;
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public object this[string key] {
get {
object value;
TryGetValue(key, out value);
return value;
}
set {
_dictionary[key] = value;
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public void Add(string key, object value) {
_dictionary.Add(key, value);
}
private void AddValues(object values) {
if (values != null) {
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(values);
foreach (PropertyDescriptor prop in props) {
object val = prop.GetValue(values);
Add(prop.Name, val);
}
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public void Clear() {
_dictionary.Clear();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public bool ContainsKey(string key) {
return _dictionary.ContainsKey(key);
}
public bool ContainsValue(object value) {
return _dictionary.ContainsValue(value);
}
public Dictionary.Enumerator GetEnumerator() {
return _dictionary.GetEnumerator();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public bool Remove(string key) {
return _dictionary.Remove(key);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
public bool TryGetValue(string key, out object value) {
return _dictionary.TryGetValue(key, out value);
}
#region IDictionary Members
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
ICollection IDictionary.Keys {
get {
return _dictionary.Keys;
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
ICollection
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XPathException.cs
- Item.cs
- PathStreamGeometryContext.cs
- SqlBooleanMismatchVisitor.cs
- OdbcRowUpdatingEvent.cs
- WorkflowMessageEventArgs.cs
- IssuedTokenServiceCredential.cs
- ObjectDataSourceStatusEventArgs.cs
- ObjectToken.cs
- SqlProcedureAttribute.cs
- UniqueIdentifierService.cs
- UnsafeNativeMethods.cs
- DBSchemaRow.cs
- NativeMethods.cs
- ObjectDataSource.cs
- IndexingContentUnit.cs
- AssociationType.cs
- FontStretchConverter.cs
- X509KeyIdentifierClauseType.cs
- SmiRecordBuffer.cs
- XsltLoader.cs
- DiscreteKeyFrames.cs
- VisualCollection.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- RtfFormatStack.cs
- RotateTransform.cs
- BitmapSizeOptions.cs
- RegexWorker.cs
- XslCompiledTransform.cs
- UdpDiscoveryMessageFilter.cs
- designeractionbehavior.cs
- CompressedStack.cs
- CharStorage.cs
- AnchoredBlock.cs
- Trigger.cs
- XamlReader.cs
- DirectoryInfo.cs
- MapPathBasedVirtualPathProvider.cs
- UrlAuthFailedErrorFormatter.cs
- InsufficientExecutionStackException.cs
- DataRelationCollection.cs
- GraphicsState.cs
- WebExceptionStatus.cs
- SiblingIterators.cs
- MasterPageCodeDomTreeGenerator.cs
- FieldToken.cs
- WindowsScrollBar.cs
- IsolatedStorage.cs
- PersonalizationStateInfoCollection.cs
- ScriptHandlerFactory.cs
- PointAnimationBase.cs
- BamlBinaryWriter.cs
- BinHexEncoder.cs
- HttpCapabilitiesBase.cs
- RSACryptoServiceProvider.cs
- XslUrlEditor.cs
- MapPathBasedVirtualPathProvider.cs
- ExecutionEngineException.cs
- RegexInterpreter.cs
- WebPartRestoreVerb.cs
- ReadOnlyDataSourceView.cs
- SystemKeyConverter.cs
- ErrorProvider.cs
- Geometry3D.cs
- SizeChangedInfo.cs
- IisHelper.cs
- AssemblySettingAttributes.cs
- SqlFunctionAttribute.cs
- MarginCollapsingState.cs
- Operator.cs
- StatusStrip.cs
- DefaultValueAttribute.cs
- TableHeaderCell.cs
- HeaderCollection.cs
- WebPartCloseVerb.cs
- Pens.cs
- cryptoapiTransform.cs
- EdgeModeValidation.cs
- FunctionDetailsReader.cs
- SafeNativeMemoryHandle.cs
- FileLevelControlBuilderAttribute.cs
- ControlCommandSet.cs
- DataTemplateKey.cs
- DataGridViewCell.cs
- AutomationPatternInfo.cs
- UnsupportedPolicyOptionsException.cs
- EntityCommandExecutionException.cs
- ArraySegment.cs
- DesignerAdRotatorAdapter.cs
- SharedPerformanceCounter.cs
- BStrWrapper.cs
- BasicKeyConstraint.cs
- Compress.cs
- Odbc32.cs
- TraceShell.cs
- NullableConverter.cs
- UnauthorizedAccessException.cs
- ProgramNode.cs
- BrowserCapabilitiesCompiler.cs
- BaseConfigurationRecord.cs