Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartZoneCollection.cs
- MethodRental.cs
- JsonReader.cs
- XmlName.cs
- ProtectedConfigurationSection.cs
- CellRelation.cs
- TextBoxBaseDesigner.cs
- RuleAction.cs
- EmptyElement.cs
- TablePattern.cs
- XmlCodeExporter.cs
- AggregationMinMaxHelpers.cs
- WebPartMinimizeVerb.cs
- QilChoice.cs
- ScrollViewerAutomationPeer.cs
- TagPrefixAttribute.cs
- SafeNativeMethods.cs
- StreamUpdate.cs
- ObjectStorage.cs
- AnnotationResourceCollection.cs
- WindowsListViewItemStartMenu.cs
- DropDownList.cs
- ViewPort3D.cs
- DebugTracing.cs
- FileUtil.cs
- ArglessEventHandlerProxy.cs
- AuthenticateEventArgs.cs
- WebPermission.cs
- Registry.cs
- FilterInvalidBodyAccessException.cs
- FixedHyperLink.cs
- DynamicAttribute.cs
- Baml2006KnownTypes.cs
- SafeTimerHandle.cs
- DefaultBinder.cs
- ProtocolsSection.cs
- FontDriver.cs
- Compiler.cs
- RegexCharClass.cs
- ClientSettingsStore.cs
- CodeSnippetTypeMember.cs
- MediaContext.cs
- ContainerParagraph.cs
- itemelement.cs
- Int32Rect.cs
- PageThemeParser.cs
- ToolStripRendererSwitcher.cs
- DataGridViewSelectedCellCollection.cs
- FamilyTypefaceCollection.cs
- EventLogQuery.cs
- StringToken.cs
- SymDocumentType.cs
- WebEventCodes.cs
- DataGridViewSelectedRowCollection.cs
- sqlcontext.cs
- WorkflowItemPresenter.cs
- QueryOperator.cs
- MouseOverProperty.cs
- SchemaCollectionCompiler.cs
- HttpHandlerActionCollection.cs
- RectAnimationUsingKeyFrames.cs
- WebPartZone.cs
- Columns.cs
- ImageSource.cs
- AdapterUtil.cs
- ReadOnlyHierarchicalDataSource.cs
- FixUp.cs
- HorizontalAlignConverter.cs
- FormatException.cs
- Stream.cs
- CFStream.cs
- SQLMembershipProvider.cs
- GetPageCompletedEventArgs.cs
- Queue.cs
- TrackingDataItemValue.cs
- TextEffectResolver.cs
- XamlSerializerUtil.cs
- XmlNamespaceMapping.cs
- SynchronizationLockException.cs
- KnownTypeHelper.cs
- ThreadBehavior.cs
- CapabilitiesState.cs
- DataGridViewCellStateChangedEventArgs.cs
- UserControlAutomationPeer.cs
- OleDbParameterCollection.cs
- MembershipPasswordException.cs
- SiteMap.cs
- ObjectReferenceStack.cs
- TextBreakpoint.cs
- EventLogPermissionAttribute.cs
- PowerStatus.cs
- LOSFormatter.cs
- GridViewCellAutomationPeer.cs
- HtmlHistory.cs
- DocumentPageView.cs
- Hyperlink.cs
- TargetInvocationException.cs
- Container.cs
- MsdtcClusterUtils.cs
- PerformanceCounter.cs