Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // // ==--== /*============================================================ ** ** 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PenCursorManager.cs
- ObjectNotFoundException.cs
- ZoneLinkButton.cs
- CryptoApi.cs
- SqlWebEventProvider.cs
- CreateUserWizard.cs
- TaskFormBase.cs
- Delegate.cs
- DirectoryInfo.cs
- Delegate.cs
- SessionEndedEventArgs.cs
- MembershipUser.cs
- WindowsEditBox.cs
- DelegatedStream.cs
- SHA384Managed.cs
- EncoderReplacementFallback.cs
- WindowsListViewGroupHelper.cs
- webproxy.cs
- TableParagraph.cs
- ProviderUtil.cs
- MetabaseReader.cs
- TextTreeRootTextBlock.cs
- Rss20FeedFormatter.cs
- DataGridTextBoxColumn.cs
- OdbcParameter.cs
- ScrollEvent.cs
- cache.cs
- XmlnsPrefixAttribute.cs
- PageThemeParser.cs
- Track.cs
- IOException.cs
- ValueUtilsSmi.cs
- TagNameToTypeMapper.cs
- ValidationErrorEventArgs.cs
- CompoundFileStreamReference.cs
- UntypedNullExpression.cs
- SerializationAttributes.cs
- ValueUnavailableException.cs
- StructuredTypeEmitter.cs
- oledbmetadatacollectionnames.cs
- BitmapPalettes.cs
- Events.cs
- Event.cs
- PermissionSetEnumerator.cs
- SqlTypeSystemProvider.cs
- SR.cs
- BorderSidesEditor.cs
- ProviderConnectionPointCollection.cs
- XmlSchemaInferenceException.cs
- XmlSchemaAny.cs
- ExpressionBuilderCollection.cs
- ModelTreeEnumerator.cs
- OSFeature.cs
- ResourceManagerWrapper.cs
- MultiSelector.cs
- DataBindEngine.cs
- MappingException.cs
- ThreadTrace.cs
- OleStrCAMarshaler.cs
- InputScopeManager.cs
- URL.cs
- HtmlEmptyTagControlBuilder.cs
- DBCommandBuilder.cs
- WrapPanel.cs
- WebPartAuthorizationEventArgs.cs
- TextElementAutomationPeer.cs
- _ListenerAsyncResult.cs
- StrongNamePublicKeyBlob.cs
- SqlDataSourceView.cs
- ScriptReference.cs
- LabelAutomationPeer.cs
- WindowsToolbarAsMenu.cs
- TypedOperationInfo.cs
- OverrideMode.cs
- ModelItem.cs
- FlowDocumentFormatter.cs
- TableMethodGenerator.cs
- ListView.cs
- HyperLinkStyle.cs
- DynamicArgumentDialog.cs
- WebPartVerbsEventArgs.cs
- VirtualPath.cs
- _ConnectOverlappedAsyncResult.cs
- ImageListUtils.cs
- DirtyTextRange.cs
- LinqDataSourceDeleteEventArgs.cs
- StdValidatorsAndConverters.cs
- AdCreatedEventArgs.cs
- CompositeDispatchFormatter.cs
- InputLanguageProfileNotifySink.cs
- WebPartCloseVerb.cs
- InkCanvasSelectionAdorner.cs
- WmfPlaceableFileHeader.cs
- FixedSOMPageElement.cs
- UiaCoreApi.cs
- RowSpanVector.cs
- HttpConfigurationSystem.cs
- CodeLabeledStatement.cs
- ExecutionContext.cs
- VirtualDirectoryMapping.cs