Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- HtmlLinkAdapter.cs
- HighlightVisual.cs
- HttpBrowserCapabilitiesBase.cs
- Attributes.cs
- DesignerSerializationVisibilityAttribute.cs
- BitmapEffectInput.cs
- DataListItem.cs
- TextRunTypographyProperties.cs
- ProxyWebPart.cs
- DefaultClaimSet.cs
- ColorInterpolationModeValidation.cs
- DatePicker.cs
- DirtyTextRange.cs
- NamespaceImport.cs
- SendContent.cs
- WriterOutput.cs
- _ConnectOverlappedAsyncResult.cs
- RegexInterpreter.cs
- EditingMode.cs
- CheckBox.cs
- TypedTableBase.cs
- WindowsStatusBar.cs
- FilePrompt.cs
- DbExpressionVisitor_TResultType.cs
- PropertyChangingEventArgs.cs
- OuterGlowBitmapEffect.cs
- ExitEventArgs.cs
- Pair.cs
- ErrorStyle.cs
- WindowsHyperlink.cs
- MDIWindowDialog.cs
- ProfessionalColorTable.cs
- ECDsaCng.cs
- Roles.cs
- WebRequest.cs
- PerformanceCounterPermissionAttribute.cs
- JournalEntryStack.cs
- SizeLimitedCache.cs
- FilePrompt.cs
- MailHeaderInfo.cs
- NeutralResourcesLanguageAttribute.cs
- JsonStringDataContract.cs
- Int32Animation.cs
- ObjectParameterCollection.cs
- Debug.cs
- DefaultParameterValueAttribute.cs
- SqlRemoveConstantOrderBy.cs
- DataGridViewImageCell.cs
- MouseWheelEventArgs.cs
- ContextProperty.cs
- WindowsScrollBarBits.cs
- RegistrationServices.cs
- FileLogRecordEnumerator.cs
- AsymmetricKeyExchangeFormatter.cs
- ObjectFullSpanRewriter.cs
- TemplateControlBuildProvider.cs
- DataTransferEventArgs.cs
- WebPartMovingEventArgs.cs
- DefaultHttpHandler.cs
- ArithmeticLiteral.cs
- FixedDSBuilder.cs
- DataObject.cs
- List.cs
- MobileSysDescriptionAttribute.cs
- PasswordPropertyTextAttribute.cs
- ExclusiveTcpListener.cs
- FrameworkContentElement.cs
- Subordinate.cs
- KeyEvent.cs
- HyperLinkDesigner.cs
- DataGridView.cs
- DropDownList.cs
- RegexCharClass.cs
- DataGridPageChangedEventArgs.cs
- StyleSheetDesigner.cs
- EndOfStreamException.cs
- DesignerCalendarAdapter.cs
- WebPartConnectionCollection.cs
- MarshalDirectiveException.cs
- ResourceProperty.cs
- DefaultProxySection.cs
- StyleBamlRecordReader.cs
- SQLMoneyStorage.cs
- MessageContractImporter.cs
- PositiveTimeSpanValidator.cs
- SupportingTokenDuplexChannel.cs
- FactorySettingsElement.cs
- TemplatedEditableDesignerRegion.cs
- BadImageFormatException.cs
- XmlILStorageConverter.cs
- AliasedSlot.cs
- UpdateRecord.cs
- Utils.cs
- SiteMapDataSource.cs
- StandardTransformFactory.cs
- webeventbuffer.cs
- LostFocusEventManager.cs
- ClosureBinding.cs
- TextCharacters.cs
- StateWorkerRequest.cs