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
- OleDbConnectionInternal.cs
- IISUnsafeMethods.cs
- XPathParser.cs
- ViewGenerator.cs
- ArgumentNullException.cs
- VariableQuery.cs
- HyperLinkField.cs
- ClrPerspective.cs
- HandleRef.cs
- PreApplicationStartMethodAttribute.cs
- WeakReadOnlyCollection.cs
- EncodingDataItem.cs
- BridgeDataReader.cs
- recordstatescratchpad.cs
- ToolboxControl.cs
- CollectionViewGroupInternal.cs
- RtfControlWordInfo.cs
- EventArgs.cs
- AutomationPeer.cs
- PersonalizablePropertyEntry.cs
- CodeComment.cs
- StrongNameIdentityPermission.cs
- SparseMemoryStream.cs
- PeerTransportCredentialType.cs
- MULTI_QI.cs
- ReliableSessionBindingElementImporter.cs
- SamlSubjectStatement.cs
- ProcessHost.cs
- ProfileServiceManager.cs
- SerializableAttribute.cs
- XmlNamespaceDeclarationsAttribute.cs
- FormViewDeletedEventArgs.cs
- AbstractExpressions.cs
- ImageInfo.cs
- TypefaceCollection.cs
- TreeNodeStyleCollection.cs
- DataGridViewColumnConverter.cs
- RequestTimeoutManager.cs
- ToolStripDropDownClosingEventArgs.cs
- CollectionChangedEventManager.cs
- ListBoxChrome.cs
- CompilerLocalReference.cs
- VerticalConnector.xaml.cs
- IndicShape.cs
- EntityTransaction.cs
- EnlistmentTraceIdentifier.cs
- AdornerPresentationContext.cs
- Dictionary.cs
- XmlSchemaType.cs
- EntityDataReader.cs
- DataColumnCollection.cs
- AuthenticateEventArgs.cs
- SignedXmlDebugLog.cs
- Tokenizer.cs
- DelegateSerializationHolder.cs
- TextMessageEncoder.cs
- EncryptedPackageFilter.cs
- DataTableNewRowEvent.cs
- PathSegmentCollection.cs
- VisualStates.cs
- HttpRequestWrapper.cs
- Recipient.cs
- WebEventTraceProvider.cs
- XamlTreeBuilder.cs
- WebServiceClientProxyGenerator.cs
- ToolboxComponentsCreatingEventArgs.cs
- CommandID.cs
- SystemColors.cs
- XmlValueConverter.cs
- RandomNumberGenerator.cs
- Enum.cs
- ContextMarshalException.cs
- MobileTemplatedControlDesigner.cs
- TextParagraphView.cs
- XmlTextAttribute.cs
- XmlReturnReader.cs
- AmbientLight.cs
- EmissiveMaterial.cs
- TextFragmentEngine.cs
- VScrollBar.cs
- FontFamily.cs
- TemplateControlParser.cs
- VirtualizingStackPanel.cs
- DLinqAssociationProvider.cs
- PartialList.cs
- MobileRedirect.cs
- ScriptReference.cs
- XmlSchemaCompilationSettings.cs
- AttachedPropertyBrowsableAttribute.cs
- CompiledELinqQueryState.cs
- ErrorHandler.cs
- CrossContextChannel.cs
- HandlerWithFactory.cs
- SymLanguageType.cs
- SqlMetaData.cs
- Floater.cs
- ProxyWebPartManagerDesigner.cs
- MobileTemplatedControlDesigner.cs
- DesignOnlyAttribute.cs
- WebOperationContext.cs