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
- VisualStateChangedEventArgs.cs
- DeclarativeCatalogPart.cs
- BufferModeSettings.cs
- NativeMethods.cs
- ManagedIStream.cs
- Clipboard.cs
- SpeechSynthesizer.cs
- PersistChildrenAttribute.cs
- Expr.cs
- DesignerLoader.cs
- PanelContainerDesigner.cs
- AcceleratedTokenAuthenticator.cs
- XmlNotation.cs
- ClrPerspective.cs
- ElementHostPropertyMap.cs
- SharedPerformanceCounter.cs
- HttpResponseBase.cs
- Compiler.cs
- RtType.cs
- EmissiveMaterial.cs
- ActivityTypeResolver.xaml.cs
- MissingFieldException.cs
- NullableDecimalSumAggregationOperator.cs
- Stacktrace.cs
- DBBindings.cs
- XmlReflectionImporter.cs
- Operand.cs
- DynamicRendererThreadManager.cs
- MeshGeometry3D.cs
- DataBindingHandlerAttribute.cs
- BitmapEffectInput.cs
- ActivityExecutionFilter.cs
- ConfigXmlAttribute.cs
- HierarchicalDataBoundControl.cs
- LogLogRecordHeader.cs
- InstanceCreationEditor.cs
- StylusShape.cs
- XmlSchemaCompilationSettings.cs
- DiscoveryClientChannelFactory.cs
- TreeNodeStyleCollection.cs
- SQLResource.cs
- FormsAuthenticationEventArgs.cs
- FormParameter.cs
- FlowDocumentPageViewerAutomationPeer.cs
- EntityModelBuildProvider.cs
- GorillaCodec.cs
- Pair.cs
- SchemaDeclBase.cs
- basecomparevalidator.cs
- CopyAction.cs
- SettingsPropertyValueCollection.cs
- InputScopeAttribute.cs
- InstanceDataCollection.cs
- _RequestCacheProtocol.cs
- InternalDispatchObject.cs
- LineSegment.cs
- printdlgexmarshaler.cs
- PointKeyFrameCollection.cs
- RtfToken.cs
- ConstrainedGroup.cs
- HttpApplication.cs
- SqlGenericUtil.cs
- DynamicHyperLink.cs
- GridSplitterAutomationPeer.cs
- OpenFileDialog.cs
- QilTypeChecker.cs
- QuadraticBezierSegment.cs
- CssStyleCollection.cs
- TdsParserStateObject.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- HyperLinkColumn.cs
- CheckableControlBaseAdapter.cs
- Zone.cs
- AddInToken.cs
- HMACSHA512.cs
- SyndicationSerializer.cs
- BridgeDataRecord.cs
- SQLGuid.cs
- WebPartPersonalization.cs
- CacheVirtualItemsEvent.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- PropertyTabChangedEvent.cs
- AutoGeneratedFieldProperties.cs
- ParseHttpDate.cs
- AspNetHostingPermission.cs
- ClientConvert.cs
- ConnectionsZone.cs
- ExtensionDataReader.cs
- IntegerValidatorAttribute.cs
- PlatformNotSupportedException.cs
- SqlFileStream.cs
- _UriSyntax.cs
- CopyOnWriteList.cs
- AuthorizationRule.cs
- MethodImplAttribute.cs
- WindowsStatic.cs
- AppDomainInstanceProvider.cs
- InfiniteIntConverter.cs
- SortedSetDebugView.cs
- LayoutManager.cs