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
- CodeAttributeArgument.cs
- DirectoryObjectSecurity.cs
- HostProtectionException.cs
- SqlOuterApplyReducer.cs
- Visual.cs
- NameSpaceExtractor.cs
- ResourceExpression.cs
- TimelineClockCollection.cs
- FragmentQuery.cs
- SimpleModelProvider.cs
- SoapFault.cs
- EncryptedPackageFilter.cs
- StreamResourceInfo.cs
- PageCache.cs
- CommonDialog.cs
- OLEDB_Enum.cs
- HttpCacheVaryByContentEncodings.cs
- Soap12FormatExtensions.cs
- AdCreatedEventArgs.cs
- ReadOnlyDataSourceView.cs
- DataGridViewCellPaintingEventArgs.cs
- ModelMemberCollection.cs
- translator.cs
- MultipartContentParser.cs
- GrammarBuilder.cs
- LabelDesigner.cs
- PartitionedStreamMerger.cs
- InternalResources.cs
- PrimitiveType.cs
- PolicyVersionConverter.cs
- GB18030Encoding.cs
- RequestCacheManager.cs
- ToolStripCustomTypeDescriptor.cs
- DesignerActionVerbList.cs
- ToolStripDesignerAvailabilityAttribute.cs
- UntrustedRecipientException.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- Lock.cs
- AndCondition.cs
- FillRuleValidation.cs
- InvalidAsynchronousStateException.cs
- GAC.cs
- WebPartTransformer.cs
- NavigationPropertySingletonExpression.cs
- DataBinding.cs
- DependencyPropertyHelper.cs
- OperationAbortedException.cs
- InvalidOperationException.cs
- BuildManager.cs
- CompilerState.cs
- HtmlFormAdapter.cs
- AudioFormatConverter.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- StringReader.cs
- EntityModelSchemaGenerator.cs
- GeometryModel3D.cs
- ProcessHostServerConfig.cs
- TraceFilter.cs
- BitmapEffectInputConnector.cs
- CodeMethodReturnStatement.cs
- SqlCachedBuffer.cs
- TypographyProperties.cs
- PointLightBase.cs
- CachedPathData.cs
- ThicknessAnimationBase.cs
- DataServiceQueryProvider.cs
- SHA1CryptoServiceProvider.cs
- SmtpNtlmAuthenticationModule.cs
- OrderByQueryOptionExpression.cs
- Delegate.cs
- PropertyTabAttribute.cs
- DbConnectionOptions.cs
- RadioButtonRenderer.cs
- DecoderNLS.cs
- IpcClientChannel.cs
- SiteMapSection.cs
- CompiledQueryCacheEntry.cs
- PackWebResponse.cs
- TypeInitializationException.cs
- NameValueConfigurationCollection.cs
- OperationGenerator.cs
- AutoSizeToolBoxItem.cs
- MediaTimeline.cs
- InputLanguageManager.cs
- XmlCustomFormatter.cs
- XPathDocument.cs
- SpecularMaterial.cs
- BooleanFunctions.cs
- MethodExpression.cs
- FeatureSupport.cs
- ArrangedElement.cs
- PixelFormat.cs
- CodeTypeOfExpression.cs
- DataGridViewHitTestInfo.cs
- EntityCollection.cs
- LineInfo.cs
- WSTrust.cs
- ConfigXmlCDataSection.cs
- ColorKeyFrameCollection.cs
- SchemaMerger.cs