Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Collections / CaseInsensitiveHashCodeProvider.cs / 1 / CaseInsensitiveHashCodeProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: CaseInsensitiveHashCodeProvider ** ** ** Purpose: Designed to support hashtables which require ** case-insensitive behavior while still maintaining case, ** this provides an efficient mechanism for getting the ** hashcode of the string ignoring case. ** ** ============================================================*/ namespace System.Collections { //This class does not contain members and does not need to be serializable using System; using System.Collections; using System.Globalization; [Serializable] [Obsolete("Please use StringComparer instead.")] [System.Runtime.InteropServices.ComVisible(true)] public class CaseInsensitiveHashCodeProvider : IHashCodeProvider { private TextInfo m_text; private static CaseInsensitiveHashCodeProvider m_InvariantCaseInsensitiveHashCodeProvider = null; public CaseInsensitiveHashCodeProvider() { m_text = CultureInfo.CurrentCulture.TextInfo; } public CaseInsensitiveHashCodeProvider(CultureInfo culture) { if (culture==null) { throw new ArgumentNullException("culture"); } m_text = culture.TextInfo; } public static CaseInsensitiveHashCodeProvider Default { get { return new CaseInsensitiveHashCodeProvider(CultureInfo.CurrentCulture); } } public static CaseInsensitiveHashCodeProvider DefaultInvariant { get { if (m_InvariantCaseInsensitiveHashCodeProvider == null) { m_InvariantCaseInsensitiveHashCodeProvider = new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture); } return m_InvariantCaseInsensitiveHashCodeProvider; } } public int GetHashCode(Object obj) { if (obj==null) { throw new ArgumentNullException("obj"); } String s = obj as String; if (s==null) { return obj.GetHashCode(); } return m_text.GetCaseInsensitiveHashCode(s); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlILAnnotation.cs
- ForEachDesigner.xaml.cs
- DbMetaDataColumnNames.cs
- XamlFilter.cs
- WindowsUpDown.cs
- CompilationUtil.cs
- WindowsContainer.cs
- Int64Converter.cs
- RangeValidator.cs
- DecoderFallback.cs
- Underline.cs
- ServiceObjectContainer.cs
- PropertyGridCommands.cs
- TextView.cs
- DocumentXmlWriter.cs
- SettingsPropertyWrongTypeException.cs
- FileUtil.cs
- AtomServiceDocumentSerializer.cs
- XmlSchemaImport.cs
- DistributedTransactionPermission.cs
- LifetimeServices.cs
- SqlCachedBuffer.cs
- GeometryCombineModeValidation.cs
- StreamResourceInfo.cs
- Menu.cs
- AliasedSlot.cs
- MemberRelationshipService.cs
- HttpCapabilitiesBase.cs
- DefaultSection.cs
- MSAANativeProvider.cs
- ContextItem.cs
- WebControlAdapter.cs
- PrivacyNoticeBindingElementImporter.cs
- ClaimComparer.cs
- PopupRoot.cs
- ChangeBlockUndoRecord.cs
- NameSpaceEvent.cs
- NamespaceImport.cs
- RuntimeEnvironment.cs
- ReferenceEqualityComparer.cs
- WeakReferenceList.cs
- NativeWindow.cs
- EntityContainerEntitySet.cs
- ResourceIDHelper.cs
- WrappedOptions.cs
- PatternMatcher.cs
- MultiBinding.cs
- ViewLoader.cs
- LabelAutomationPeer.cs
- DateTimeValueSerializerContext.cs
- OleDbMetaDataFactory.cs
- ChannelDispatcherBase.cs
- RoleGroupCollection.cs
- MessageQueuePermission.cs
- MulticastDelegate.cs
- DuplexChannelBinder.cs
- _AuthenticationState.cs
- MetadataFile.cs
- X509CertificateCollection.cs
- PenLineJoinValidation.cs
- CodeTypeConstructor.cs
- StreamSecurityUpgradeInitiatorBase.cs
- PersonalizableTypeEntry.cs
- GeometryCollection.cs
- RuleProcessor.cs
- UserControlCodeDomTreeGenerator.cs
- InvalidProgramException.cs
- FontDialog.cs
- DocumentViewerBase.cs
- AnnotationObservableCollection.cs
- RewritingPass.cs
- XmlCDATASection.cs
- JsonWriterDelegator.cs
- SessionEndedEventArgs.cs
- ObjectDataSourceMethodEventArgs.cs
- CodeIdentifiers.cs
- TemplateBuilder.cs
- DBCSCodePageEncoding.cs
- StylusOverProperty.cs
- Item.cs
- OdbcConnectionPoolProviderInfo.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- sqlcontext.cs
- DriveNotFoundException.cs
- DateTimeValueSerializerContext.cs
- TableRow.cs
- TargetConverter.cs
- UshortList2.cs
- HttpCapabilitiesSectionHandler.cs
- TextFormatterImp.cs
- FillBehavior.cs
- DataGridTextBox.cs
- CatalogPartChrome.cs
- MultiDataTrigger.cs
- ServiceBehaviorAttribute.cs
- contentDescriptor.cs
- ToolStripPanelRow.cs
- DataGridViewEditingControlShowingEventArgs.cs
- PasswordTextNavigator.cs
- RepeaterCommandEventArgs.cs