Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / Collections / Specialized / StringDictionaryWithComparer.cs / 1305376 / StringDictionaryWithComparer.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- // StringDictionary compares keys by converting them to lowercase first, using the Invariant culture. // This is not the right thing to do for file names, registry keys, environment variable etc. // This internal version of StringDictionary accepts an IEqualityComparer and enables you to // customize the string comparison to be StringComparer.OrdinalIgnoreCase for the above cases. namespace System.Collections.Specialized { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.Collections; using System.ComponentModel.Design.Serialization; using System.Globalization; [Serializable] internal class StringDictionaryWithComparer : StringDictionary { public StringDictionaryWithComparer() : this(StringComparer.OrdinalIgnoreCase) { } public StringDictionaryWithComparer(IEqualityComparer comparer) { ReplaceHashtable(new Hashtable(comparer)); } public override string this[string key] { get { if( key == null ) { throw new ArgumentNullException("key"); } return (string) contents[key]; } set { if( key == null ) { throw new ArgumentNullException("key"); } contents[key] = value; } } public override void Add(string key, string value) { if( key == null ) { throw new ArgumentNullException("key"); } contents.Add(key, value); } public override bool ContainsKey(string key) { if( key == null ) { throw new ArgumentNullException("key"); } return contents.ContainsKey(key); } public override void Remove(string key) { if( key == null ) { throw new ArgumentNullException("key"); } contents.Remove(key); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IndexedGlyphRun.cs
- WebPartEditVerb.cs
- ArgumentException.cs
- CharStorage.cs
- DataSetMappper.cs
- HandledEventArgs.cs
- ZoneIdentityPermission.cs
- PageThemeParser.cs
- SQLStringStorage.cs
- TaskHelper.cs
- Odbc32.cs
- ClientSideProviderDescription.cs
- CodeCatchClause.cs
- SessionSwitchEventArgs.cs
- panel.cs
- CompositeScriptReferenceEventArgs.cs
- SmtpException.cs
- FormsAuthenticationEventArgs.cs
- ToolStripDropDownItem.cs
- UdpSocketReceiveManager.cs
- ProcessModelSection.cs
- WebProxyScriptElement.cs
- StorageMappingItemLoader.cs
- MessageSecurityOverMsmq.cs
- TcpHostedTransportConfiguration.cs
- RegularExpressionValidator.cs
- TypeGeneratedEventArgs.cs
- HttpsHostedTransportConfiguration.cs
- FontCacheUtil.cs
- CultureInfo.cs
- WSTrustDec2005.cs
- RectIndependentAnimationStorage.cs
- WebPartChrome.cs
- ActiveXContainer.cs
- VariantWrapper.cs
- AttachmentService.cs
- _SSPIWrapper.cs
- JsonXmlDataContract.cs
- TimelineCollection.cs
- MappingException.cs
- ColumnWidthChangedEvent.cs
- DiffuseMaterial.cs
- basevalidator.cs
- FrameworkRichTextComposition.cs
- Odbc32.cs
- JsonWriter.cs
- NativeRecognizer.cs
- FormsAuthenticationUserCollection.cs
- CommandBindingCollection.cs
- Deflater.cs
- TemplateContainer.cs
- ProviderBase.cs
- ResourceType.cs
- WorkflowServiceBehavior.cs
- OdbcConnectionPoolProviderInfo.cs
- ContentWrapperAttribute.cs
- VisualTreeUtils.cs
- VectorCollectionConverter.cs
- PopupRoot.cs
- CellTreeSimplifier.cs
- LinkTarget.cs
- MD5HashHelper.cs
- BuildManager.cs
- AbandonedMutexException.cs
- Root.cs
- Literal.cs
- PageHandlerFactory.cs
- Registration.cs
- WebPartExportVerb.cs
- ReliableMessagingVersion.cs
- TimerEventSubscriptionCollection.cs
- MailAddressParser.cs
- SqlCommand.cs
- GridViewCommandEventArgs.cs
- PixelFormat.cs
- SafeSystemMetrics.cs
- BitmapCodecInfoInternal.cs
- OrderByExpression.cs
- OperationCanceledException.cs
- DBSqlParserTable.cs
- Matrix.cs
- FontUnitConverter.cs
- DocumentGrid.cs
- CompilerLocalReference.cs
- TypeListConverter.cs
- ExceptionUtil.cs
- SmiXetterAccessMap.cs
- Vector3dCollection.cs
- ISCIIEncoding.cs
- DataGridViewCellLinkedList.cs
- FrameworkElementAutomationPeer.cs
- UnmanagedMemoryStream.cs
- Label.cs
- CreatingCookieEventArgs.cs
- PersistStreamTypeWrapper.cs
- ToolboxBitmapAttribute.cs
- FontSizeConverter.cs
- SqlConnectionString.cs
- BevelBitmapEffect.cs
- TripleDESCryptoServiceProvider.cs