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
- StylusPlugin.cs
- SqlNode.cs
- State.cs
- XmlSortKeyAccumulator.cs
- TemplateControlBuildProvider.cs
- DataGridLinkButton.cs
- NTAccount.cs
- HtmlTextArea.cs
- TemplateField.cs
- CodeArrayIndexerExpression.cs
- ComplexTypeEmitter.cs
- OletxTransactionHeader.cs
- Scripts.cs
- TypedReference.cs
- TextShapeableCharacters.cs
- _NativeSSPI.cs
- InstanceData.cs
- SerialStream.cs
- SchemaAttDef.cs
- SafeNativeMethodsMilCoreApi.cs
- SoapProtocolReflector.cs
- CompositionTarget.cs
- Transform3DCollection.cs
- SafeRegistryHandle.cs
- CannotUnloadAppDomainException.cs
- SimpleBitVector32.cs
- XslCompiledTransform.cs
- basecomparevalidator.cs
- OutputCacheSettingsSection.cs
- InputProviderSite.cs
- StrongName.cs
- WebBrowser.cs
- LayoutUtils.cs
- CodeTypeParameter.cs
- BevelBitmapEffect.cs
- WriterOutput.cs
- HostVisual.cs
- DataContract.cs
- CommandDevice.cs
- EnvelopedPkcs7.cs
- CacheSection.cs
- WebPartZoneBase.cs
- ViewStateModeByIdAttribute.cs
- Matrix.cs
- Compilation.cs
- NativeMethods.cs
- DrawingContext.cs
- DuplexChannelBinder.cs
- BackStopAuthenticationModule.cs
- XD.cs
- DesignerActionListCollection.cs
- OdbcDataReader.cs
- FormatSettings.cs
- RijndaelManaged.cs
- ListView.cs
- SqlDataSourceSelectingEventArgs.cs
- DocumentSchemaValidator.cs
- ProjectionPruner.cs
- PersonalizableAttribute.cs
- TreeView.cs
- PerformanceCountersElement.cs
- ContextStack.cs
- regiisutil.cs
- ContextMenu.cs
- CloseCryptoHandleRequest.cs
- _BaseOverlappedAsyncResult.cs
- ManifestResourceInfo.cs
- GeometryCollection.cs
- JumpTask.cs
- TrustSection.cs
- ScriptModule.cs
- SpellerInterop.cs
- XmlDataLoader.cs
- DataGridItemAttachedStorage.cs
- ControlPropertyNameConverter.cs
- _HeaderInfoTable.cs
- TemplateNameScope.cs
- HttpCacheVaryByContentEncodings.cs
- XmlAttributes.cs
- SqlDataAdapter.cs
- DoubleIndependentAnimationStorage.cs
- DataGridSortCommandEventArgs.cs
- ToolStripTextBox.cs
- PrintEvent.cs
- RuntimeResourceSet.cs
- XsltQilFactory.cs
- PaperSize.cs
- Switch.cs
- EntityContainerEmitter.cs
- RenderingEventArgs.cs
- HtmlEmptyTagControlBuilder.cs
- ExpressionCopier.cs
- DotAtomReader.cs
- AssociatedControlConverter.cs
- XmlAttributeCache.cs
- SiteMapNodeCollection.cs
- DataContractSerializerSection.cs
- ImageCodecInfoPrivate.cs
- RegisteredHiddenField.cs
- FileSecurity.cs