Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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: [....]: 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
- CompModSwitches.cs
- LogWriteRestartAreaState.cs
- SqlStream.cs
- LockedActivityGlyph.cs
- DocumentsTrace.cs
- HttpAsyncResult.cs
- sqlmetadatafactory.cs
- KeyConverter.cs
- ProfileSettings.cs
- ManipulationInertiaStartingEventArgs.cs
- TabPanel.cs
- XmlConverter.cs
- EntityKeyElement.cs
- figurelength.cs
- BufferedMessageData.cs
- CompiledRegexRunner.cs
- LockCookie.cs
- XmlDataLoader.cs
- DefaultValueAttribute.cs
- AppDomainUnloadedException.cs
- SortedSet.cs
- FilteredAttributeCollection.cs
- KernelTypeValidation.cs
- LinqDataSource.cs
- ResXBuildProvider.cs
- SaveFileDialog.cs
- DataGridViewCheckBoxColumn.cs
- ObjectParameter.cs
- HotSpotCollection.cs
- NameValueCollection.cs
- CacheSection.cs
- SqlProfileProvider.cs
- DbSetClause.cs
- ResourcesGenerator.cs
- ObjectTag.cs
- WpfKnownType.cs
- RelatedPropertyManager.cs
- ParallelDesigner.cs
- SelectionChangedEventArgs.cs
- ListenerServiceInstallComponent.cs
- ScriptResourceAttribute.cs
- AssociationSet.cs
- MemoryFailPoint.cs
- CharAnimationUsingKeyFrames.cs
- RemoteWebConfigurationHostServer.cs
- StringConverter.cs
- HttpResponseHeader.cs
- BitmapEffect.cs
- InitializerFacet.cs
- CodeObjectCreateExpression.cs
- LogLogRecord.cs
- AbstractDataSvcMapFileLoader.cs
- ToolStripDropDownDesigner.cs
- XmlToDatasetMap.cs
- SQLUtility.cs
- NullableLongMinMaxAggregationOperator.cs
- Image.cs
- IndentedWriter.cs
- DataListItem.cs
- ComboBoxDesigner.cs
- ObjectStateEntryDbDataRecord.cs
- ObfuscateAssemblyAttribute.cs
- GroupBox.cs
- DPTypeDescriptorContext.cs
- AutomationTextAttribute.cs
- MethodToken.cs
- SchemaTableColumn.cs
- MetabaseSettingsIis7.cs
- UnmanagedMemoryStreamWrapper.cs
- WindowsAuthenticationEventArgs.cs
- Soap12FormatExtensions.cs
- ManipulationVelocities.cs
- ZipPackage.cs
- RsaSecurityKey.cs
- ProfileInfo.cs
- IxmlLineInfo.cs
- WorkflowStateRollbackService.cs
- TextRunCacheImp.cs
- PathFigureCollectionValueSerializer.cs
- BevelBitmapEffect.cs
- TextAction.cs
- ProgressChangedEventArgs.cs
- DbInsertCommandTree.cs
- TextContainer.cs
- SerializationException.cs
- EntitySetBase.cs
- WpfPayload.cs
- RangeValuePatternIdentifiers.cs
- DuplicateWaitObjectException.cs
- BevelBitmapEffect.cs
- MembershipValidatePasswordEventArgs.cs
- DataGridItem.cs
- CryptoApi.cs
- ExtendedPropertyDescriptor.cs
- EntryIndex.cs
- EmptyEnumerator.cs
- PrintSchema.cs
- PairComparer.cs
- RuntimeIdentifierPropertyAttribute.cs
- FrugalList.cs