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
- SoapSchemaImporter.cs
- WhitespaceRuleReader.cs
- HashHelper.cs
- DelimitedListTraceListener.cs
- Timer.cs
- DataConnectionHelper.cs
- CalendarItem.cs
- CrossContextChannel.cs
- SrgsElementFactoryCompiler.cs
- BinaryObjectReader.cs
- CodeExpressionRuleDeclaration.cs
- InternalControlCollection.cs
- List.cs
- TableRow.cs
- ListSortDescription.cs
- MailBnfHelper.cs
- PackageDigitalSignature.cs
- GraphicsPathIterator.cs
- WinFormsUtils.cs
- DesignTimeSiteMapProvider.cs
- TrackingParameters.cs
- TableChangeProcessor.cs
- ToolStripControlHost.cs
- GenerateHelper.cs
- mediaeventargs.cs
- CharacterShapingProperties.cs
- VersionPair.cs
- DataGridViewHeaderCell.cs
- UrlMappingsModule.cs
- FilteredAttributeCollection.cs
- PostBackTrigger.cs
- InvalidChannelBindingException.cs
- SymmetricKeyWrap.cs
- IntegerValidatorAttribute.cs
- ReliableChannelFactory.cs
- DataGridViewButtonCell.cs
- ObjectDataSourceStatusEventArgs.cs
- UnionCodeGroup.cs
- MatrixIndependentAnimationStorage.cs
- XmlCompatibilityReader.cs
- UserControlCodeDomTreeGenerator.cs
- EdmValidator.cs
- __Error.cs
- Rotation3DAnimationBase.cs
- ComplexBindingPropertiesAttribute.cs
- HitTestParameters3D.cs
- CodeGeneratorOptions.cs
- UshortList2.cs
- TemplateColumn.cs
- XmlValueConverter.cs
- XmlNamespaceMappingCollection.cs
- BaseValidatorDesigner.cs
- ContentElement.cs
- DrawingAttributes.cs
- MultilineStringEditor.cs
- PassportIdentity.cs
- mediaeventargs.cs
- ParseNumbers.cs
- ModuleConfigurationInfo.cs
- _ChunkParse.cs
- ExpandedWrapper.cs
- InstanceHandleConflictException.cs
- ImageKeyConverter.cs
- DataGridRelationshipRow.cs
- FixedHighlight.cs
- TransactionManager.cs
- SelectionChangedEventArgs.cs
- InternalResources.cs
- SoapReflectionImporter.cs
- SplineQuaternionKeyFrame.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- StreamWriter.cs
- DependencyPropertyValueSerializer.cs
- AvtEvent.cs
- MenuStrip.cs
- Point3DIndependentAnimationStorage.cs
- AttachedPropertiesService.cs
- TimeSpan.cs
- TreeView.cs
- CheckBox.cs
- DependencyPropertyAttribute.cs
- ECDsaCng.cs
- TypeSystem.cs
- BitmapEffectState.cs
- SQLDateTimeStorage.cs
- PointHitTestResult.cs
- SocketPermission.cs
- MenuDesigner.cs
- TextCollapsingProperties.cs
- Automation.cs
- NullableDoubleAverageAggregationOperator.cs
- CqlWriter.cs
- Stroke2.cs
- EdgeModeValidation.cs
- MouseOverProperty.cs
- RegexMatch.cs
- DataServiceProcessingPipeline.cs
- RuleRefElement.cs
- XmlSortKey.cs
- ExtendedTransformFactory.cs