Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- BmpBitmapDecoder.cs
- EntityWithChangeTrackerStrategy.cs
- SelectedGridItemChangedEvent.cs
- ListViewGroupItemCollection.cs
- InternalMappingException.cs
- PointLightBase.cs
- StorageSetMapping.cs
- XmlSchemaValidationException.cs
- BitmapFrameDecode.cs
- MatrixConverter.cs
- PropertyNames.cs
- ToolBarOverflowPanel.cs
- PeerPresenceInfo.cs
- XmlAnyElementAttributes.cs
- AdornedElementPlaceholder.cs
- HttpCachePolicyWrapper.cs
- SuppressIldasmAttribute.cs
- FileRecordSequence.cs
- SchemaTableOptionalColumn.cs
- NavigationProperty.cs
- TouchEventArgs.cs
- DesignerProperties.cs
- TabletDeviceInfo.cs
- ImplicitInputBrush.cs
- DefaultTextStoreTextComposition.cs
- PropertySegmentSerializer.cs
- FontResourceCache.cs
- RefreshResponseInfo.cs
- PropertyCollection.cs
- SizeFConverter.cs
- COM2FontConverter.cs
- ConcurrentQueue.cs
- AdapterUtil.cs
- CannotUnloadAppDomainException.cs
- OpCellTreeNode.cs
- Site.cs
- WebPermission.cs
- AuthenticationModuleElement.cs
- ByteBufferPool.cs
- PresentationAppDomainManager.cs
- XmlBinaryWriter.cs
- CodeDelegateInvokeExpression.cs
- StreamGeometry.cs
- HitTestWithPointDrawingContextWalker.cs
- ViewGenerator.cs
- EmptyQuery.cs
- GB18030Encoding.cs
- Sql8ConformanceChecker.cs
- SymbolType.cs
- CompiledIdentityConstraint.cs
- MsmqInputSessionChannel.cs
- SettingsPropertyNotFoundException.cs
- LogEntryHeaderv1Deserializer.cs
- MimeWriter.cs
- WorkflowApplicationEventArgs.cs
- NewExpression.cs
- XamlVector3DCollectionSerializer.cs
- ListViewItem.cs
- UDPClient.cs
- LinqDataSourceStatusEventArgs.cs
- PipeConnection.cs
- GPStream.cs
- QueryCacheKey.cs
- OdbcEnvironmentHandle.cs
- AttachInfo.cs
- Style.cs
- UpdatePanelControlTrigger.cs
- EntityDataSourceDesignerHelper.cs
- PhysicalFontFamily.cs
- ResourceAttributes.cs
- UriSchemeKeyedCollection.cs
- securitycriticaldataClass.cs
- IChannel.cs
- TextServicesCompartmentEventSink.cs
- CompositeActivityTypeDescriptor.cs
- ReservationNotFoundException.cs
- EncodingStreamWrapper.cs
- CodeSubDirectory.cs
- InlinedAggregationOperator.cs
- SspiNegotiationTokenAuthenticatorState.cs
- RenderOptions.cs
- ContactManager.cs
- RadioButtonBaseAdapter.cs
- ReversePositionQuery.cs
- ParseElementCollection.cs
- InputLanguageProfileNotifySink.cs
- EmptyElement.cs
- QilList.cs
- SelectorItemAutomationPeer.cs
- IndexedString.cs
- XmlQueryStaticData.cs
- StateRuntime.cs
- HealthMonitoringSection.cs
- XmlRawWriter.cs
- ContentElement.cs
- WebBrowserHelper.cs
- FixedSOMLineRanges.cs
- TemplatePartAttribute.cs
- Soap.cs
- WhiteSpaceTrimStringConverter.cs