Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MexHttpBindingCollectionElement.cs
- PopupEventArgs.cs
- UrlPath.cs
- NamedPipeDuplicateContext.cs
- BitVector32.cs
- XPathDocumentBuilder.cs
- PreProcessor.cs
- DetailsViewDeletedEventArgs.cs
- DesignerForm.cs
- ProfileParameter.cs
- DataServiceHost.cs
- InsufficientMemoryException.cs
- UseLicense.cs
- DataGridPageChangedEventArgs.cs
- TransformFinalBlockRequest.cs
- SqlSelectStatement.cs
- OutputCache.cs
- updatecommandorderer.cs
- XmlDataLoader.cs
- AnyAllSearchOperator.cs
- LinqDataSourceStatusEventArgs.cs
- CodeCastExpression.cs
- TemplateBindingExtensionConverter.cs
- RuleProcessor.cs
- ConfigXmlElement.cs
- DatatypeImplementation.cs
- DataSourceGeneratorException.cs
- AuthenticateEventArgs.cs
- NameSpaceExtractor.cs
- ValueType.cs
- QueryStringParameter.cs
- Vector.cs
- CultureInfoConverter.cs
- RelationshipWrapper.cs
- BitmapEditor.cs
- RowsCopiedEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- DataContractSerializerSection.cs
- RemoteWebConfigurationHost.cs
- VirtualStackFrame.cs
- NominalTypeEliminator.cs
- ApplicationGesture.cs
- DeferredSelectedIndexReference.cs
- COM2Properties.cs
- EntityDataSourceContainerNameConverter.cs
- CollectionsUtil.cs
- OutputCacheSettingsSection.cs
- GridPatternIdentifiers.cs
- MsmqElementBase.cs
- TreeView.cs
- ListView.cs
- GridViewRowPresenterBase.cs
- TypeConverter.cs
- DataGridHeaderBorder.cs
- InputLanguageManager.cs
- Executor.cs
- Internal.cs
- AnimatedTypeHelpers.cs
- AssemblyAttributesGoHere.cs
- ScalarOps.cs
- DataObjectFieldAttribute.cs
- CombinedGeometry.cs
- Renderer.cs
- SqlDataSource.cs
- StructuredTypeEmitter.cs
- ProfileProvider.cs
- MarshalByValueComponent.cs
- Roles.cs
- RuntimeDelegateArgument.cs
- QueuePathDialog.cs
- ChoiceConverter.cs
- DataServiceException.cs
- StrongTypingException.cs
- Pens.cs
- ContainerAction.cs
- WebBrowserEvent.cs
- SendSecurityHeader.cs
- SQLInt16.cs
- EventLogger.cs
- ValidationErrorCollection.cs
- StringStorage.cs
- SHA256Managed.cs
- ToolStripContentPanel.cs
- GroupItem.cs
- ContentPosition.cs
- GradientBrush.cs
- Executor.cs
- UInt64.cs
- XamlPathDataSerializer.cs
- WebPartDescription.cs
- ButtonBaseDesigner.cs
- PointValueSerializer.cs
- OutputScope.cs
- SqlAliasesReferenced.cs
- Mappings.cs
- WebControlAdapter.cs
- KeyToListMap.cs
- StylusPointPropertyInfo.cs
- ObjectDataSourceSelectingEventArgs.cs
- _NtlmClient.cs