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
- RepeatButton.cs
- AbstractDataSvcMapFileLoader.cs
- FormViewModeEventArgs.cs
- TargetConverter.cs
- Canvas.cs
- MatchingStyle.cs
- StylusCaptureWithinProperty.cs
- CookielessHelper.cs
- HandleRef.cs
- OdbcUtils.cs
- ClientEventManager.cs
- MatchAttribute.cs
- DocumentSequence.cs
- PropertyDescriptorGridEntry.cs
- TextEditorLists.cs
- FeatureSupport.cs
- XmlReaderSettings.cs
- TraceHandler.cs
- TableDetailsCollection.cs
- DataGridState.cs
- XamlStyleSerializer.cs
- IndentedWriter.cs
- SafeThreadHandle.cs
- OracleColumn.cs
- storepermissionattribute.cs
- PocoEntityKeyStrategy.cs
- DispatcherTimer.cs
- CollectionChangeEventArgs.cs
- SourceElementsCollection.cs
- SafePointer.cs
- Literal.cs
- SafeNativeMethods.cs
- DNS.cs
- WebServicesSection.cs
- DataBoundControlHelper.cs
- PngBitmapDecoder.cs
- CharAnimationUsingKeyFrames.cs
- WorkflowInstanceRecord.cs
- ValidationErrorEventArgs.cs
- SqlReferenceCollection.cs
- StreamUpdate.cs
- DataObjectAttribute.cs
- ConfigsHelper.cs
- ChildDocumentBlock.cs
- PreProcessInputEventArgs.cs
- HotSpot.cs
- Dispatcher.cs
- PropertyValueChangedEvent.cs
- IntegerValidatorAttribute.cs
- ColorAnimationUsingKeyFrames.cs
- StateManagedCollection.cs
- WebControl.cs
- InvalidCastException.cs
- RegexParser.cs
- CriticalHandle.cs
- MarshalDirectiveException.cs
- SimpleMailWebEventProvider.cs
- XsltSettings.cs
- CodeTypeReferenceExpression.cs
- Privilege.cs
- DataControlFieldCollection.cs
- ContainerSelectorBehavior.cs
- smtppermission.cs
- ReadOnlyDictionary.cs
- DbProviderConfigurationHandler.cs
- StringCollectionEditor.cs
- GridViewColumnCollection.cs
- DPTypeDescriptorContext.cs
- ContextBase.cs
- WebColorConverter.cs
- AmbientProperties.cs
- IndentedTextWriter.cs
- PersonalizableTypeEntry.cs
- CompilerHelpers.cs
- KeyPressEvent.cs
- xdrvalidator.cs
- PasswordRecovery.cs
- RuntimeConfigurationRecord.cs
- Vector3D.cs
- Stackframe.cs
- TransformerInfoCollection.cs
- DataControlFieldCollection.cs
- XmlCollation.cs
- TerminateDesigner.cs
- SettingsProperty.cs
- ELinqQueryState.cs
- Bitmap.cs
- EmptyQuery.cs
- FieldToken.cs
- ToolStripSplitButton.cs
- DbExpressionVisitor.cs
- SQLString.cs
- TypeHelpers.cs
- Binding.cs
- WaitHandleCannotBeOpenedException.cs
- PasswordTextContainer.cs
- ImageField.cs
- DefaultWorkflowTransactionService.cs
- BitmapImage.cs
- GridPattern.cs