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
- AttachInfo.cs
- ToolboxDataAttribute.cs
- ButtonPopupAdapter.cs
- KoreanCalendar.cs
- DataObjectCopyingEventArgs.cs
- SqlNodeAnnotations.cs
- QilParameter.cs
- GroupByExpressionRewriter.cs
- PersistenceProviderDirectory.cs
- HostingEnvironment.cs
- RangeValueProviderWrapper.cs
- ElementAction.cs
- FillErrorEventArgs.cs
- ManagedFilter.cs
- InitializerFacet.cs
- FunctionImportMapping.cs
- UserNameSecurityTokenProvider.cs
- VSDExceptions.cs
- SqlUdtInfo.cs
- TrackingServices.cs
- ListItemCollection.cs
- JsonReader.cs
- PathNode.cs
- MetadataUtilsSmi.cs
- TrackingServices.cs
- OdbcConnectionOpen.cs
- ValidationHelper.cs
- DBDataPermission.cs
- FileEnumerator.cs
- PropertyValidationContext.cs
- ClientSettingsProvider.cs
- Scheduler.cs
- PropertySourceInfo.cs
- ResourceManager.cs
- Vector3D.cs
- ExtensionDataReader.cs
- NativeRecognizer.cs
- ObsoleteAttribute.cs
- XmlIlGenerator.cs
- ReadOnlyDictionary.cs
- ResourcesGenerator.cs
- MulticastNotSupportedException.cs
- ProviderCollection.cs
- XmlSerializationGeneratedCode.cs
- OleDbPropertySetGuid.cs
- WizardPanel.cs
- GuidelineCollection.cs
- SafePEFileHandle.cs
- OperatingSystem.cs
- NumberFunctions.cs
- ForceCopyBuildProvider.cs
- MeshGeometry3D.cs
- HandlerMappingMemo.cs
- LoginUtil.cs
- _CommandStream.cs
- InfoCardMasterKey.cs
- LongValidator.cs
- DebuggerService.cs
- ContentPlaceHolderDesigner.cs
- MemberHolder.cs
- User.cs
- DeploymentExceptionMapper.cs
- ProviderIncompatibleException.cs
- precedingsibling.cs
- XmlSchemaSimpleTypeRestriction.cs
- WindowsButton.cs
- Aes.cs
- InfocardChannelParameter.cs
- CardSpaceException.cs
- AttributeUsageAttribute.cs
- WebPartConnectionCollection.cs
- XmlQualifiedNameTest.cs
- ReadOnlyMetadataCollection.cs
- EmptyControlCollection.cs
- TextPatternIdentifiers.cs
- ChannelSinkStacks.cs
- Axis.cs
- Visual3DCollection.cs
- IxmlLineInfo.cs
- ObjectItemLoadingSessionData.cs
- X509Chain.cs
- TableItemProviderWrapper.cs
- IDispatchConstantAttribute.cs
- ObjectHandle.cs
- DesignBinding.cs
- SR.cs
- ToolStripContentPanelDesigner.cs
- RuleSettings.cs
- ViewValidator.cs
- DrawingContext.cs
- LoginView.cs
- RadioButton.cs
- EntitySqlException.cs
- ProfileSettings.cs
- Root.cs
- ListViewItemMouseHoverEvent.cs
- ToolStripItemDesigner.cs
- EdmFunctionAttribute.cs
- ScrollBarRenderer.cs
- FontUnit.cs