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
- XmlWriterDelegator.cs
- ExpressionBuilder.cs
- Internal.cs
- ToolStripContainer.cs
- WorkflowIdleBehavior.cs
- XhtmlBasicCalendarAdapter.cs
- ResourceSet.cs
- Configuration.cs
- NetworkCredential.cs
- panel.cs
- Environment.cs
- FieldDescriptor.cs
- ConvertTextFrag.cs
- PseudoWebRequest.cs
- VirtualPathUtility.cs
- MinimizableAttributeTypeConverter.cs
- QilLoop.cs
- _SingleItemRequestCache.cs
- RoutedEvent.cs
- DrawingCollection.cs
- CodeDirectoryCompiler.cs
- SizeAnimationBase.cs
- ScrollChangedEventArgs.cs
- VectorCollection.cs
- AbandonedMutexException.cs
- FastPropertyAccessor.cs
- LinqDataView.cs
- TableLayoutPanel.cs
- wgx_exports.cs
- AddDataControlFieldDialog.cs
- TextEditorDragDrop.cs
- UnmanagedMarshal.cs
- RefType.cs
- InputLangChangeRequestEvent.cs
- ReaderOutput.cs
- VirtualizingPanel.cs
- TemplateDefinition.cs
- SmiMetaData.cs
- TrackingMemoryStream.cs
- XmlCompatibilityReader.cs
- TypeLibConverter.cs
- SafeEventLogWriteHandle.cs
- DecoderReplacementFallback.cs
- QilSortKey.cs
- HandlerBase.cs
- ImageFormatConverter.cs
- AuthenticationModuleElement.cs
- LayoutDump.cs
- ScrollItemProviderWrapper.cs
- LongAverageAggregationOperator.cs
- SignedPkcs7.cs
- Point3DKeyFrameCollection.cs
- GetBrowserTokenRequest.cs
- FacetEnabledSchemaElement.cs
- TabletCollection.cs
- TextModifier.cs
- AnimatedTypeHelpers.cs
- OrderedEnumerableRowCollection.cs
- IconHelper.cs
- TdsParser.cs
- RadioButtonBaseAdapter.cs
- ReverseComparer.cs
- SchemaElementLookUpTableEnumerator.cs
- Attributes.cs
- SchemaConstraints.cs
- XmlHierarchicalDataSourceView.cs
- BodyGlyph.cs
- CodeCastExpression.cs
- TypedElement.cs
- SrgsNameValueTag.cs
- ErrorReporting.cs
- SecurityVerifiedMessage.cs
- StringFreezingAttribute.cs
- RegisteredDisposeScript.cs
- BuildManager.cs
- StringConverter.cs
- StylusPointPropertyUnit.cs
- Privilege.cs
- SamlSecurityTokenAuthenticator.cs
- Table.cs
- DataBoundControlAdapter.cs
- DataGridBoolColumn.cs
- ShadowGlyph.cs
- SoapFormatExtensions.cs
- RegexWriter.cs
- AuthenticationModulesSection.cs
- TrackingCondition.cs
- SystemIPv6InterfaceProperties.cs
- EntityContainerAssociationSet.cs
- DesignerAutoFormatCollection.cs
- VectorCollection.cs
- CreateRefExpr.cs
- _BufferOffsetSize.cs
- EncodingDataItem.cs
- GZipDecoder.cs
- DbBuffer.cs
- ZipFileInfo.cs
- LogSwitch.cs
- XmlUtf8RawTextWriter.cs
- DbMetaDataFactory.cs