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
- InnerItemCollectionView.cs
- SplitterEvent.cs
- LogReserveAndAppendState.cs
- TableAdapterManagerHelper.cs
- HorizontalAlignConverter.cs
- DbDataReader.cs
- FontNamesConverter.cs
- MainMenu.cs
- SafeFileMapViewHandle.cs
- Transactions.cs
- SingleConverter.cs
- HandoffBehavior.cs
- ElementMarkupObject.cs
- XmlParserContext.cs
- PathFigureCollectionConverter.cs
- IssuanceLicense.cs
- NumberSubstitution.cs
- UdpTransportSettings.cs
- EmptyEnumerator.cs
- SHA1Managed.cs
- HTMLTextWriter.cs
- SplitterCancelEvent.cs
- PipeConnection.cs
- RealizationDrawingContextWalker.cs
- ListViewGroup.cs
- FlowDocumentPaginator.cs
- ButtonPopupAdapter.cs
- TableCell.cs
- HttpErrorTraceRecord.cs
- HitTestFilterBehavior.cs
- CommandBinding.cs
- FlowDocumentPaginator.cs
- DispatchWrapper.cs
- SoapTypeAttribute.cs
- _NativeSSPI.cs
- QuadTree.cs
- SetStateDesigner.cs
- ToolStripLabel.cs
- ImageBrush.cs
- ParameterBuilder.cs
- DataErrorValidationRule.cs
- Events.cs
- FeatureSupport.cs
- OverlappedContext.cs
- PersonalizationState.cs
- OleDbTransaction.cs
- PngBitmapEncoder.cs
- HttpDictionary.cs
- Dump.cs
- SrgsGrammar.cs
- SQLByteStorage.cs
- NotifyCollectionChangedEventArgs.cs
- filewebrequest.cs
- ValueTypePropertyReference.cs
- X509AsymmetricSecurityKey.cs
- ObjectViewQueryResultData.cs
- NewItemsContextMenuStrip.cs
- TaskFileService.cs
- mda.cs
- ItemContainerGenerator.cs
- DayRenderEvent.cs
- ConstrainedGroup.cs
- ExpandableObjectConverter.cs
- TextSchema.cs
- SqlDataSourceCommandEventArgs.cs
- CharacterMetricsDictionary.cs
- _HeaderInfoTable.cs
- ReadOnlyCollection.cs
- GenericEnumerator.cs
- XPathExpr.cs
- ToolStrip.cs
- Gdiplus.cs
- FrameworkElementFactoryMarkupObject.cs
- SynchronizedInputAdaptor.cs
- EntityConnection.cs
- LicenseProviderAttribute.cs
- AuthenticatedStream.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- Vector3DCollectionConverter.cs
- CompilerErrorCollection.cs
- GridViewSortEventArgs.cs
- SiblingIterators.cs
- UpdateRecord.cs
- DbConnectionPoolCounters.cs
- ReplacementText.cs
- VerticalConnector.xaml.cs
- ProviderException.cs
- EncodingInfo.cs
- TreeViewImageKeyConverter.cs
- MemberNameValidator.cs
- COM2PropertyDescriptor.cs
- CodeStatement.cs
- SoapSchemaExporter.cs
- ApplicationManager.cs
- IncrementalReadDecoders.cs
- XmlSiteMapProvider.cs
- ToolStripStatusLabel.cs
- VirtualDirectoryMappingCollection.cs
- XmlTypeAttribute.cs
- FontCacheUtil.cs