Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / MS / Internal / IO / Packaging / CaseInsensitiveOrdinalStringComparer.cs / 1305600 / 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: [....]: 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: [....]: 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- fixedPageContentExtractor.cs
- UnsafeNativeMethods.cs
- CompositeControl.cs
- TemplateControl.cs
- CodeDirectionExpression.cs
- GeometryDrawing.cs
- WindowsGraphics.cs
- NamedObjectList.cs
- ContentType.cs
- MoveSizeWinEventHandler.cs
- PolygonHotSpot.cs
- SchemaDeclBase.cs
- SkipStoryboardToFill.cs
- EdgeProfileValidation.cs
- LayoutSettings.cs
- DocumentPageViewAutomationPeer.cs
- HistoryEventArgs.cs
- SamlSecurityTokenAuthenticator.cs
- GraphicsPath.cs
- DBDataPermissionAttribute.cs
- ToggleProviderWrapper.cs
- SEHException.cs
- HandleCollector.cs
- DataServiceQueryProvider.cs
- Stylesheet.cs
- SelectionService.cs
- MsdtcWrapper.cs
- NativeMethods.cs
- DiscoveryEndpoint.cs
- RSAPKCS1SignatureFormatter.cs
- Vector3DValueSerializer.cs
- SQLByte.cs
- Evidence.cs
- SoapWriter.cs
- HttpCachePolicyWrapper.cs
- BaseDataListComponentEditor.cs
- ProcessModuleCollection.cs
- Vector.cs
- ScriptResourceAttribute.cs
- Binding.cs
- Utility.cs
- GetPageNumberCompletedEventArgs.cs
- EdmValidator.cs
- CloudCollection.cs
- ActivityInstanceMap.cs
- Win32KeyboardDevice.cs
- DataMember.cs
- ExecutedRoutedEventArgs.cs
- InkCollectionBehavior.cs
- ColumnWidthChangingEvent.cs
- parserscommon.cs
- BufferedReadStream.cs
- ActivityInstanceReference.cs
- XmlSchemaValidator.cs
- InvalidDataException.cs
- CategoryGridEntry.cs
- XmlDomTextWriter.cs
- DPCustomTypeDescriptor.cs
- XmlILAnnotation.cs
- Substitution.cs
- Tuple.cs
- DropTarget.cs
- HtmlHead.cs
- Rotation3D.cs
- ConnectionOrientedTransportChannelListener.cs
- TitleStyle.cs
- ProxyHwnd.cs
- BeginEvent.cs
- MenuDesigner.cs
- SplashScreen.cs
- Script.cs
- NameValueFileSectionHandler.cs
- SmtpException.cs
- RecognizerBase.cs
- BitmapEffectInput.cs
- PerformanceCounterManager.cs
- EdmToObjectNamespaceMap.cs
- BmpBitmapDecoder.cs
- ListViewPagedDataSource.cs
- WebControlToolBoxItem.cs
- WebReferencesBuildProvider.cs
- HttpRuntime.cs
- WebService.cs
- CreateUserWizardDesigner.cs
- EncoderParameters.cs
- DataKeyArray.cs
- shaperfactoryquerycacheentry.cs
- NullableFloatAverageAggregationOperator.cs
- CollaborationHelperFunctions.cs
- TabletDeviceInfo.cs
- SpecularMaterial.cs
- TokenizerHelper.cs
- WmlControlAdapter.cs
- FlowLayout.cs
- LiteralControl.cs
- DocumentPageView.cs
- HitTestResult.cs
- UrlMappingsSection.cs
- EntityAdapter.cs
- DependencyObject.cs