Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Base / MS / Internal / IO / Packaging / CaseInsensitiveOrdinalStringComparer.cs / 1 / CaseInsensitiveOrdinalStringComparer.cs
//------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Common container-related operations that can be shared among internal // components. // // History: // 02/17/2006: younggk: Creation // //----------------------------------------------------------------------------- using System; using System.Collections; // for IEqualityComparer using MS.Internal; // for Invariant.Assert namespace MS.Internal.IO.Packaging { ////// IEqualityComparer implementation for case insensistive ordinal strings /// internal class CaseInsensitiveOrdinalStringComparer : IEqualityComparer, IComparer { // Performs Case Insensitive Ordinal String Comparison. bool IEqualityComparer.Equals(Object x, Object y) { Invariant.Assert((x is String) && (y is String)); return (String.CompareOrdinal(((String) x).ToUpperInvariant(), ((String) y).ToUpperInvariant()) == 0); } int IComparer.Compare(Object x, Object y) { Invariant.Assert((x is String) && (y is String)); return String.CompareOrdinal(((String) x).ToUpperInvariant(), ((String) y).ToUpperInvariant()); } // Hash on object identity. int IEqualityComparer.GetHashCode(Object str) { Invariant.Assert(str is String); return ((String) str).ToUpperInvariant().GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Common container-related operations that can be shared among internal // components. // // History: // 02/17/2006: younggk: Creation // //----------------------------------------------------------------------------- using System; using System.Collections; // for IEqualityComparer using MS.Internal; // for Invariant.Assert namespace MS.Internal.IO.Packaging { ////// IEqualityComparer implementation for case insensistive ordinal strings /// internal class CaseInsensitiveOrdinalStringComparer : IEqualityComparer, IComparer { // Performs Case Insensitive Ordinal String Comparison. bool IEqualityComparer.Equals(Object x, Object y) { Invariant.Assert((x is String) && (y is String)); return (String.CompareOrdinal(((String) x).ToUpperInvariant(), ((String) y).ToUpperInvariant()) == 0); } int IComparer.Compare(Object x, Object y) { Invariant.Assert((x is String) && (y is String)); return String.CompareOrdinal(((String) x).ToUpperInvariant(), ((String) y).ToUpperInvariant()); } // Hash on object identity. int IEqualityComparer.GetHashCode(Object str) { Invariant.Assert(str is String); return ((String) str).ToUpperInvariant().GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GeneralTransform3DGroup.cs
- GeneralTransformCollection.cs
- SafeRightsManagementPubHandle.cs
- Predicate.cs
- StreamInfo.cs
- RestHandler.cs
- WrappedKeySecurityToken.cs
- CodeAttachEventStatement.cs
- StringArrayConverter.cs
- SymLanguageType.cs
- CmsUtils.cs
- BadImageFormatException.cs
- Label.cs
- TableParagraph.cs
- UTF8Encoding.cs
- CheckBoxFlatAdapter.cs
- OracleColumn.cs
- TextBreakpoint.cs
- PolicyManager.cs
- XmlElementList.cs
- RuntimeWrappedException.cs
- NeutralResourcesLanguageAttribute.cs
- ImageUrlEditor.cs
- CompensateDesigner.cs
- objectresult_tresulttype.cs
- DebuggerAttributes.cs
- HttpModuleActionCollection.cs
- XamlParser.cs
- DataView.cs
- EntityConnection.cs
- FontNamesConverter.cs
- DocumentViewerAutomationPeer.cs
- BrowsableAttribute.cs
- CollectionViewProxy.cs
- ListBindingConverter.cs
- DesignTimeData.cs
- UniqueID.cs
- EventTrigger.cs
- StylusPointPropertyInfoDefaults.cs
- TextContainerHelper.cs
- entitydatasourceentitysetnameconverter.cs
- Signature.cs
- GridViewAutoFormat.cs
- MultiSelector.cs
- followingsibling.cs
- WeakRefEnumerator.cs
- ModifierKeysConverter.cs
- ProcessModuleCollection.cs
- QuaternionAnimationUsingKeyFrames.cs
- IntSecurity.cs
- Int32Rect.cs
- IntersectQueryOperator.cs
- SevenBitStream.cs
- ComEventsMethod.cs
- MouseButton.cs
- SafeNativeMethods.cs
- TerminatorSinks.cs
- GenericQueueSurrogate.cs
- PropertySegmentSerializer.cs
- UnitControl.cs
- RuleInfoComparer.cs
- JsonServiceDocumentSerializer.cs
- AdPostCacheSubstitution.cs
- PtsHelper.cs
- IndexedWhereQueryOperator.cs
- Table.cs
- WebAdminConfigurationHelper.cs
- Interlocked.cs
- DaylightTime.cs
- ResourceContainer.cs
- ImageFormatConverter.cs
- TCEAdapterGenerator.cs
- CoTaskMemHandle.cs
- AssemblyNameProxy.cs
- TemplatePropertyEntry.cs
- AspNetSynchronizationContext.cs
- DropShadowEffect.cs
- PrimitiveDataContract.cs
- NewItemsContextMenuStrip.cs
- FixedSOMPageElement.cs
- LinkedList.cs
- ResolvedKeyFrameEntry.cs
- EmulateRecognizeCompletedEventArgs.cs
- XslTransformFileEditor.cs
- QilParameter.cs
- SyntaxCheck.cs
- EventsTab.cs
- PeerNameRecord.cs
- AccessDataSourceView.cs
- TextPatternIdentifiers.cs
- DataGridViewCellLinkedList.cs
- ViewStateModeByIdAttribute.cs
- IPAddress.cs
- BadImageFormatException.cs
- DeferredTextReference.cs
- WebHttpElement.cs
- NullableConverter.cs
- XsdSchemaFileEditor.cs
- SelectionListComponentEditor.cs
- Pkcs7Recipient.cs