Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Util / SymbolEqualComparer.cs / 1 / SymbolEqualComparer.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System.Collections; using System.Globalization; ////// internal class SymbolEqualComparer: IComparer { ////// For internal use only. This implements a comparison that only /// checks for equalilty, so this should only be used in un-sorted data /// structures like Hastable and ListDictionary. This is a little faster /// than using CaseInsensitiveComparer because it does a strict character by /// character equality chech rather than a sorted comparison. /// ////// internal static readonly IComparer Default = new SymbolEqualComparer(); internal SymbolEqualComparer() { } int IComparer.Compare(object keyLeft, object keyRight) { string sLeft = keyLeft as string; string sRight = keyRight as string; if (sLeft == null) { throw new ArgumentNullException("keyLeft"); } if (sRight == null) { throw new ArgumentNullException("keyRight"); } int lLeft = sLeft.Length; int lRight = sRight.Length; if (lLeft != lRight) { return 1; } for (int i = 0; i < lLeft; i++) { char charLeft = sLeft[i]; char charRight = sRight[i]; if (charLeft == charRight) { continue; } UnicodeCategory catLeft = Char.GetUnicodeCategory(charLeft); UnicodeCategory catRight = Char.GetUnicodeCategory(charRight); if (catLeft == UnicodeCategory.UppercaseLetter && catRight == UnicodeCategory.LowercaseLetter) { if (Char.ToLower(charLeft, CultureInfo.InvariantCulture) == charRight) { continue; } } else if (catRight == UnicodeCategory.UppercaseLetter && catLeft == UnicodeCategory.LowercaseLetter){ if (Char.ToLower(charRight, CultureInfo.InvariantCulture) == charLeft) { continue; } } return 1; } return 0; } } }[To be supplied.] ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MarginsConverter.cs
- ResourceManagerWrapper.cs
- Pool.cs
- X509WindowsSecurityToken.cs
- CodeMemberField.cs
- ISessionStateStore.cs
- FontFamily.cs
- XamlReader.cs
- StateWorkerRequest.cs
- ReadContentAsBinaryHelper.cs
- connectionpool.cs
- UIElement.cs
- SubqueryRules.cs
- FacetDescription.cs
- AnnotationAuthorChangedEventArgs.cs
- RegisteredDisposeScript.cs
- ConfigurationValidatorAttribute.cs
- DataGridColumnCollection.cs
- DbProviderFactories.cs
- MsmqHostedTransportConfiguration.cs
- WeakReference.cs
- PropertyToken.cs
- SafeSerializationManager.cs
- IPAddress.cs
- VisualTreeHelper.cs
- PointAnimation.cs
- ApplicationSecurityManager.cs
- EventBuilder.cs
- NavigationHelper.cs
- ResourceContainerWrapper.cs
- InputReportEventArgs.cs
- File.cs
- TdsValueSetter.cs
- ConstraintCollection.cs
- TextBreakpoint.cs
- TransformGroup.cs
- PropertyConverter.cs
- HandoffBehavior.cs
- ProfileSettings.cs
- BrowserCapabilitiesCodeGenerator.cs
- FilterableAttribute.cs
- StorageEndPropertyMapping.cs
- RepeatButton.cs
- SymbolMethod.cs
- TextDecorationCollection.cs
- SamlAttribute.cs
- HttpResponse.cs
- ToolStrip.cs
- TextElementCollection.cs
- BufferModeSettings.cs
- PageThemeCodeDomTreeGenerator.cs
- StackOverflowException.cs
- PageContent.cs
- FormsAuthenticationCredentials.cs
- MediaContext.cs
- BitmapScalingModeValidation.cs
- SqlDataReader.cs
- SiteMapDataSourceDesigner.cs
- ViewCellSlot.cs
- DataBindingsDialog.cs
- ToolStripContainerActionList.cs
- XmlSchemaProviderAttribute.cs
- BitVector32.cs
- SqlGatherProducedAliases.cs
- ResourceIDHelper.cs
- BitmapEffect.cs
- MessageSmuggler.cs
- SourceElementsCollection.cs
- HttpCapabilitiesSectionHandler.cs
- TextBoxAutoCompleteSourceConverter.cs
- TabletDevice.cs
- HyperLinkDesigner.cs
- TransformPattern.cs
- MetadataItem.cs
- CompilerTypeWithParams.cs
- _Win32.cs
- DataPagerFieldCommandEventArgs.cs
- BamlMapTable.cs
- BufferAllocator.cs
- ObjectDataSource.cs
- XmlSiteMapProvider.cs
- RegexCode.cs
- BinarySerializer.cs
- FormViewDeletedEventArgs.cs
- SpellerHighlightLayer.cs
- SQLInt16.cs
- Compiler.cs
- SecurityRuntime.cs
- RadioButton.cs
- View.cs
- GPPOINTF.cs
- CopyNamespacesAction.cs
- TemplateBindingExpressionConverter.cs
- SizeConverter.cs
- SQLSingleStorage.cs
- BasicHttpBindingElement.cs
- SR.cs
- FactoryMaker.cs
- FixedTextView.cs
- ClrPerspective.cs