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
- TextModifier.cs
- CodeCompiler.cs
- EntityCollection.cs
- TypeSource.cs
- QilIterator.cs
- CreateRefExpr.cs
- DefaultValidator.cs
- ValueProviderWrapper.cs
- Visual3DCollection.cs
- PropertyInfoSet.cs
- EpmSourceTree.cs
- GeometryGroup.cs
- PatternMatcher.cs
- ConfigurationStrings.cs
- TextViewBase.cs
- userdatakeys.cs
- BindingGroup.cs
- PeerChannelListener.cs
- Attributes.cs
- SystemIPInterfaceStatistics.cs
- ComponentEditorForm.cs
- ResourceDictionary.cs
- PageBuildProvider.cs
- FrameworkContentElementAutomationPeer.cs
- SqlUtils.cs
- XamlDesignerSerializationManager.cs
- PropertyChangedEventManager.cs
- TimeSpan.cs
- ReferencedCollectionType.cs
- LongValidator.cs
- DBDataPermissionAttribute.cs
- RoleGroup.cs
- VBCodeProvider.cs
- Rect3DConverter.cs
- SqlCacheDependencyDatabaseCollection.cs
- RegexMatchCollection.cs
- DataBindingExpressionBuilder.cs
- PropagatorResult.cs
- DependencyPropertyChangedEventArgs.cs
- baseaxisquery.cs
- WindowsRichEdit.cs
- RegistryExceptionHelper.cs
- PassportAuthenticationModule.cs
- PolyLineSegment.cs
- ProfileSection.cs
- UpdateManifestForBrowserApplication.cs
- MessageHeaderException.cs
- CompilerResults.cs
- ThicknessConverter.cs
- CompiledQueryCacheEntry.cs
- TableRowCollection.cs
- OutputCacheSettings.cs
- DbTransaction.cs
- Int32RectConverter.cs
- AddInDeploymentState.cs
- OutOfProcStateClientManager.cs
- WebBrowsableAttribute.cs
- LoadRetryStrategyFactory.cs
- DesignerAttribute.cs
- IndexerNameAttribute.cs
- OpenTypeLayout.cs
- ToolStripStatusLabel.cs
- State.cs
- CharAnimationBase.cs
- QueryCacheManager.cs
- IBuiltInEvidence.cs
- JsonStringDataContract.cs
- GZipStream.cs
- ViewKeyConstraint.cs
- EmptyStringExpandableObjectConverter.cs
- StateChangeEvent.cs
- EntityDesignerUtils.cs
- TextEditorSelection.cs
- securitycriticaldata.cs
- CssClassPropertyAttribute.cs
- SymbolDocumentGenerator.cs
- TreeBuilder.cs
- XPathItem.cs
- MethodRental.cs
- MediaSystem.cs
- NavigationCommands.cs
- ACL.cs
- ContextCorrelationInitializer.cs
- VarInfo.cs
- UrlPropertyAttribute.cs
- NamespaceTable.cs
- ParameterBuilder.cs
- HtmlUtf8RawTextWriter.cs
- Main.cs
- SiteMapHierarchicalDataSourceView.cs
- NumericUpDownAcceleration.cs
- Stacktrace.cs
- CipherData.cs
- FileReservationCollection.cs
- ModulesEntry.cs
- RouteCollection.cs
- PersonalizationDictionary.cs
- ParseHttpDate.cs
- CustomAttribute.cs
- Rules.cs