Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ObjectDataSourceSelectingEventArgs.cs
- HttpProfileBase.cs
- EpmSyndicationContentSerializer.cs
- UIElementIsland.cs
- Line.cs
- RepeaterItem.cs
- AppDomainAttributes.cs
- HtmlInputReset.cs
- filewebresponse.cs
- Compilation.cs
- RtfToXamlReader.cs
- prompt.cs
- FormClosingEvent.cs
- Logging.cs
- Function.cs
- odbcmetadatafactory.cs
- ReadOnlyCollectionBase.cs
- TextFormatterHost.cs
- AmbientEnvironment.cs
- FamilyCollection.cs
- TextElementCollection.cs
- SecurityHeader.cs
- Opcode.cs
- StaticDataManager.cs
- WindowsGraphics.cs
- HtmlInputSubmit.cs
- DynamicMethod.cs
- StringWriter.cs
- Symbol.cs
- TdsParserStaticMethods.cs
- HwndMouseInputProvider.cs
- Stream.cs
- Symbol.cs
- CodeGenHelper.cs
- MetadataArtifactLoaderResource.cs
- SchemaImporterExtensionElement.cs
- HwndHost.cs
- BuiltInExpr.cs
- PersonalizationDictionary.cs
- Pair.cs
- HelpInfo.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- XmlSignatureProperties.cs
- SiteMapNode.cs
- NullReferenceException.cs
- GeneralTransform3DTo2D.cs
- UserControl.cs
- OleDbMetaDataFactory.cs
- BoundColumn.cs
- DataGridViewHeaderCell.cs
- DataList.cs
- DataGridBeginningEditEventArgs.cs
- ExpressionConverter.cs
- WorkflowDefinitionContext.cs
- ToolStripOverflow.cs
- RegexGroupCollection.cs
- COM2Enum.cs
- UnsettableComboBox.cs
- XamlStyleSerializer.cs
- MergeFilterQuery.cs
- AtlasWeb.Designer.cs
- TextParagraphProperties.cs
- XmlDataSourceDesigner.cs
- DocumentScope.cs
- SimpleHandlerBuildProvider.cs
- SchemaTableOptionalColumn.cs
- SecurityKeyIdentifierClause.cs
- StaticSiteMapProvider.cs
- SelfIssuedTokenFactoryCredential.cs
- SqlMetaData.cs
- ClusterRegistryConfigurationProvider.cs
- PropertyGridEditorPart.cs
- Menu.cs
- ToolboxItemLoader.cs
- SolidBrush.cs
- Sql8ExpressionRewriter.cs
- URLAttribute.cs
- ExceptionHandler.cs
- WindowsToolbar.cs
- arc.cs
- FilteredSchemaElementLookUpTable.cs
- SoapIgnoreAttribute.cs
- DataRowExtensions.cs
- SessionState.cs
- StorageAssociationTypeMapping.cs
- ContentType.cs
- Message.cs
- TypeDescriptionProviderAttribute.cs
- diagnosticsswitches.cs
- SmtpSection.cs
- ServiceEndpointAssociationProvider.cs
- RegisteredDisposeScript.cs
- ArrangedElementCollection.cs
- RelatedImageListAttribute.cs
- NodeFunctions.cs
- FlowchartDesigner.xaml.cs
- ToolStripDropTargetManager.cs
- TargetControlTypeAttribute.cs
- DesignerDeviceConfig.cs
- StatusBarPanelClickEvent.cs