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
- ChtmlPageAdapter.cs
- SymLanguageType.cs
- ToolStripRendererSwitcher.cs
- ConfigXmlReader.cs
- SecurityIdentifierConverter.cs
- RawTextInputReport.cs
- DesignBindingPicker.cs
- ZipPackagePart.cs
- ObjectContextServiceProvider.cs
- XmlElementAttribute.cs
- IImplicitResourceProvider.cs
- QueryableDataSourceEditData.cs
- RemotingConfigParser.cs
- CheckBoxList.cs
- EntityViewGenerator.cs
- TimersDescriptionAttribute.cs
- FixedSOMLineRanges.cs
- WebPartDisplayModeCancelEventArgs.cs
- DependsOnAttribute.cs
- UTF7Encoding.cs
- ScriptingProfileServiceSection.cs
- EmptyEnumerable.cs
- WsiProfilesElementCollection.cs
- NamespaceExpr.cs
- CookieParameter.cs
- OdbcFactory.cs
- RootAction.cs
- UpdateRecord.cs
- StringFreezingAttribute.cs
- UInt64.cs
- RedirectionProxy.cs
- Parser.cs
- SqlUDTStorage.cs
- ActivityTypeCodeDomSerializer.cs
- CodeMethodInvokeExpression.cs
- _NegotiateClient.cs
- GeneralTransform.cs
- MessagePartDescriptionCollection.cs
- SynchronizationScope.cs
- MessageQueuePermissionAttribute.cs
- ResourceKey.cs
- OperationAbortedException.cs
- NativeMethods.cs
- SafeLibraryHandle.cs
- UnregisterInfo.cs
- TextRange.cs
- SingleObjectCollection.cs
- KeyValuePairs.cs
- CopyCodeAction.cs
- Msec.cs
- bidPrivateBase.cs
- SpeechEvent.cs
- ImageConverter.cs
- SecurityCredentialsManager.cs
- TextBox.cs
- FilteredDataSetHelper.cs
- GregorianCalendarHelper.cs
- DrawingCollection.cs
- BindingList.cs
- ArrayList.cs
- SocketAddress.cs
- RMPublishingDialog.cs
- SQLInt64Storage.cs
- JavaScriptSerializer.cs
- ProcessModelInfo.cs
- RegexStringValidatorAttribute.cs
- TextBoxAutomationPeer.cs
- EntitySetDataBindingList.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- XmlSerializationReader.cs
- HandleRef.cs
- RoutedUICommand.cs
- SvcMapFileLoader.cs
- CodeDomSerializer.cs
- TransportReplyChannelAcceptor.cs
- DrawListViewColumnHeaderEventArgs.cs
- Substitution.cs
- SecurityElement.cs
- XmlNodeList.cs
- BaseTreeIterator.cs
- ModuleConfigurationInfo.cs
- VoiceSynthesis.cs
- DictionaryEntry.cs
- EncryptedKey.cs
- ParsedAttributeCollection.cs
- ScrollChangedEventArgs.cs
- StdValidatorsAndConverters.cs
- GridViewEditEventArgs.cs
- HttpChannelHelper.cs
- CompilerCollection.cs
- NoPersistHandle.cs
- TextSelectionHelper.cs
- PrintingPermission.cs
- HitTestWithGeometryDrawingContextWalker.cs
- HtmlFormWrapper.cs
- AuthenticationException.cs
- Function.cs
- CategoryNameCollection.cs
- AssociatedControlConverter.cs
- TextEvent.cs