Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TransformerTypeCollection.cs
- SpellerHighlightLayer.cs
- SerializationException.cs
- SpStreamWrapper.cs
- TableRowCollection.cs
- RegistryKey.cs
- PrinterUnitConvert.cs
- CommandConverter.cs
- HttpFileCollectionWrapper.cs
- EntityDescriptor.cs
- CompModSwitches.cs
- RC2.cs
- TextControlDesigner.cs
- RoleServiceManager.cs
- NavigationProgressEventArgs.cs
- LogicalMethodInfo.cs
- SpeakInfo.cs
- Pkcs9Attribute.cs
- RichTextBox.cs
- LinearGradientBrush.cs
- MulticastOption.cs
- _SSPIWrapper.cs
- RadioButton.cs
- WebPartEventArgs.cs
- MappedMetaModel.cs
- XmlQueryType.cs
- DataGridViewRowsRemovedEventArgs.cs
- lengthconverter.cs
- DynamicObject.cs
- MeasurementDCInfo.cs
- PriorityQueue.cs
- ObjectTag.cs
- SqlClientPermission.cs
- CultureTable.cs
- SchemaType.cs
- Invariant.cs
- AttributeQuery.cs
- ExpressionPrinter.cs
- SpellerStatusTable.cs
- HostedImpersonationContext.cs
- RtfToXamlLexer.cs
- DocumentViewerHelper.cs
- EventPropertyMap.cs
- AllMembershipCondition.cs
- FileDialogCustomPlace.cs
- BindingSource.cs
- Guid.cs
- StoreItemCollection.cs
- localization.cs
- SqlInternalConnection.cs
- CodeActivityContext.cs
- PropertyChange.cs
- RegexParser.cs
- RoutedEventConverter.cs
- XmlPreloadedResolver.cs
- TextEditorTyping.cs
- SemanticKeyElement.cs
- HybridObjectCache.cs
- TextStore.cs
- Gdiplus.cs
- MimeBasePart.cs
- ImageInfo.cs
- VolatileResourceManager.cs
- WsdlBuildProvider.cs
- ValidationEventArgs.cs
- ServicePoint.cs
- DrawingDrawingContext.cs
- LocalIdKeyIdentifierClause.cs
- DataGridViewComboBoxEditingControl.cs
- AssociationSet.cs
- SendKeys.cs
- PDBReader.cs
- HttpCachePolicyBase.cs
- QueryOpeningEnumerator.cs
- CapabilitiesUse.cs
- wgx_sdk_version.cs
- VoiceObjectToken.cs
- RootDesignerSerializerAttribute.cs
- WebPartCloseVerb.cs
- HandleRef.cs
- References.cs
- AudioFormatConverter.cs
- TransformGroup.cs
- TabPanel.cs
- StorageTypeMapping.cs
- UnsignedPublishLicense.cs
- BlobPersonalizationState.cs
- KeyProperty.cs
- ComNativeDescriptor.cs
- GeneralTransform3DTo2DTo3D.cs
- ControlParameter.cs
- SqlBulkCopy.cs
- SpecialFolderEnumConverter.cs
- TableRow.cs
- Exceptions.cs
- XMLSyntaxException.cs
- SystemResourceKey.cs
- XmlEncodedRawTextWriter.cs
- X509Certificate2.cs
- SelfIssuedAuthRSAPKCS1SignatureDeformatter.cs