Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- WebControlAdapter.cs
- MonthCalendar.cs
- ToolBar.cs
- WindowsListViewItem.cs
- xmlglyphRunInfo.cs
- CompoundFileIOPermission.cs
- GZipStream.cs
- DataGridViewAdvancedBorderStyle.cs
- PolicyUnit.cs
- MiniAssembly.cs
- InvalidCastException.cs
- DataGridCaption.cs
- DateRangeEvent.cs
- FocusManager.cs
- TransactionOptions.cs
- SdlChannelSink.cs
- XMLUtil.cs
- JulianCalendar.cs
- FrameworkContentElement.cs
- RegexCode.cs
- CompensatableSequenceActivity.cs
- DataRowView.cs
- FindCriteriaApril2005.cs
- MetadataArtifactLoaderCompositeResource.cs
- ListControl.cs
- Debug.cs
- HierarchicalDataBoundControlAdapter.cs
- ListViewPagedDataSource.cs
- ObjectDataSource.cs
- StylusCaptureWithinProperty.cs
- HostingPreferredMapPath.cs
- HandleRef.cs
- XamlToRtfParser.cs
- DocumentSequenceHighlightLayer.cs
- MachineKeySection.cs
- ClientData.cs
- Transactions.cs
- DataGridPagingPage.cs
- BinaryFormatterSinks.cs
- Paragraph.cs
- TrustLevelCollection.cs
- DbTransaction.cs
- Type.cs
- SqlWorkflowInstanceStore.cs
- PersonalizablePropertyEntry.cs
- SAPICategories.cs
- InlineCollection.cs
- ScheduleChanges.cs
- CounterNameConverter.cs
- LicFileLicenseProvider.cs
- CompilationSection.cs
- CodePageEncoding.cs
- WizardPanelChangingEventArgs.cs
- HtmlMeta.cs
- SizeFConverter.cs
- GrammarBuilderPhrase.cs
- WindowsGraphicsCacheManager.cs
- SetIterators.cs
- AssemblyBuilder.cs
- CompiledQuery.cs
- assemblycache.cs
- AncestorChangedEventArgs.cs
- XmlSignificantWhitespace.cs
- ControlType.cs
- LocationReferenceValue.cs
- HttpApplication.cs
- SiteOfOriginContainer.cs
- RoutedEventHandlerInfo.cs
- EnumerableCollectionView.cs
- XPathEmptyIterator.cs
- FixedTextPointer.cs
- ContentType.cs
- DataGridLinkButton.cs
- SafePEFileHandle.cs
- CLSCompliantAttribute.cs
- Visitor.cs
- ISO2022Encoding.cs
- SamlAuthenticationStatement.cs
- HtmlEncodedRawTextWriter.cs
- ContentPresenter.cs
- WebFormDesignerActionService.cs
- PartialClassGenerationTaskInternal.cs
- SHA1.cs
- Evidence.cs
- ContentType.cs
- ConfigurationStrings.cs
- XmlCollation.cs
- UndoManager.cs
- ToolStripMenuItemDesigner.cs
- MatrixCamera.cs
- XsltContext.cs
- DataColumnPropertyDescriptor.cs
- util.cs
- DockPattern.cs
- WorkflowServiceHost.cs
- SQlBooleanStorage.cs
- ProfileService.cs
- EmptyWithCancelationCheckWorkItem.cs
- SecurityKeyUsage.cs
- UpDownEvent.cs