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
- ProfileGroupSettings.cs
- InvalidComObjectException.cs
- MetadataUtil.cs
- PasswordTextContainer.cs
- DataGridViewSelectedRowCollection.cs
- AssociationSet.cs
- PermissionRequestEvidence.cs
- AssociationSetMetadata.cs
- ProfilePropertyMetadata.cs
- SwitchElementsCollection.cs
- FixedSchema.cs
- LogicalCallContext.cs
- ITreeGenerator.cs
- UnmanagedMemoryStream.cs
- ImageCodecInfo.cs
- CriticalHandle.cs
- GeometryDrawing.cs
- ISO2022Encoding.cs
- PolyLineSegmentFigureLogic.cs
- ChangePassword.cs
- XmlUrlEditor.cs
- BufferedGraphics.cs
- ResXFileRef.cs
- ConfigurationConverterBase.cs
- EmbeddedMailObject.cs
- FunctionParameter.cs
- XmlCodeExporter.cs
- SettingsBindableAttribute.cs
- OdbcStatementHandle.cs
- SignedXml.cs
- Track.cs
- CacheSection.cs
- LogWriteRestartAreaAsyncResult.cs
- DataTransferEventArgs.cs
- InstanceData.cs
- FlagsAttribute.cs
- QilStrConcat.cs
- _emptywebproxy.cs
- TdsParserSessionPool.cs
- RSAPKCS1KeyExchangeFormatter.cs
- XmlMemberMapping.cs
- SerializationException.cs
- WorkflowRuntime.cs
- XmlHelper.cs
- TextEditorSelection.cs
- Item.cs
- DoubleLinkListEnumerator.cs
- HttpConfigurationSystem.cs
- SizeKeyFrameCollection.cs
- Brush.cs
- ExpandSegment.cs
- BamlRecordReader.cs
- RoleBoolean.cs
- ImageFormat.cs
- Int16Storage.cs
- ReadOnlyCollection.cs
- PropertyMetadata.cs
- ProfileGroupSettingsCollection.cs
- Italic.cs
- XmlEncApr2001.cs
- SafeNativeMethods.cs
- XmlSchemaSimpleContent.cs
- EdmProviderManifest.cs
- AtomContentProperty.cs
- DataTableReader.cs
- StreamGeometry.cs
- DocumentViewerAutomationPeer.cs
- MimeBasePart.cs
- Translator.cs
- ProfileGroupSettings.cs
- SqlDataSourceEnumerator.cs
- SqlUserDefinedAggregateAttribute.cs
- SaveFileDialog.cs
- ClientBuildManager.cs
- ColorMap.cs
- ColorAnimationBase.cs
- SqlDataSourceView.cs
- ProcessThreadCollection.cs
- InitializationEventAttribute.cs
- EntityTemplateFactory.cs
- Int64.cs
- SystemWebSectionGroup.cs
- HtmlWindow.cs
- UriSectionReader.cs
- SettingsPropertyIsReadOnlyException.cs
- Utils.cs
- XamlReaderHelper.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- SqlGenericUtil.cs
- GeneralTransform3DTo2D.cs
- RectangleHotSpot.cs
- SoapReflectionImporter.cs
- IdentityValidationException.cs
- AccessedThroughPropertyAttribute.cs
- PropertyDescriptorGridEntry.cs
- ObjectKeyFrameCollection.cs
- NameValueCollection.cs
- XmlSerializerFactory.cs
- ListMarkerSourceInfo.cs
- SQLMoney.cs