Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Collections / CompatibleComparer.cs / 1 / CompatibleComparer.cs
namespace System.Collections { [Serializable()] internal class CompatibleComparer: IEqualityComparer { IComparer _comparer; #pragma warning disable 618 IHashCodeProvider _hcp; internal CompatibleComparer(IComparer comparer, IHashCodeProvider hashCodeProvider) { _comparer = comparer; _hcp = hashCodeProvider; } #pragma warning restore 618 public int Compare(Object a, Object b) { if (a == b) return 0; if (a == null) return -1; if (b == null) return 1; if (_comparer != null) return _comparer.Compare(a,b); IComparable ia = a as IComparable; if (ia != null) return ia.CompareTo(b); throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable")); } public new bool Equals(Object a, Object b) { return Compare(a, b) == 0; } public int GetHashCode(Object obj) { if( obj == null) { throw new ArgumentNullException("obj"); } if (_hcp != null) return _hcp.GetHashCode(obj); return obj.GetHashCode(); } // These are helpers for the Hashtable to query the IKeyComparer infrastructure. internal IComparer Comparer { get { return _comparer; } } // These are helpers for the Hashtable to query the IKeyComparer infrastructure. #pragma warning disable 618 internal IHashCodeProvider HashCodeProvider { get { return _hcp; } } #pragma warning restore 618 } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TemplateManager.cs
- RuntimeConfig.cs
- Config.cs
- ReflectionPermission.cs
- DbConnectionPoolIdentity.cs
- InputMethod.cs
- EditCommandColumn.cs
- Parser.cs
- base64Transforms.cs
- MimeMultiPart.cs
- SslSecurityTokenParameters.cs
- NumberSubstitution.cs
- SmiMetaDataProperty.cs
- SafeFileMapViewHandle.cs
- ExecutedRoutedEventArgs.cs
- MimeBasePart.cs
- DebugView.cs
- BufferBuilder.cs
- PagesChangedEventArgs.cs
- AuthenticationModuleElementCollection.cs
- BoundsDrawingContextWalker.cs
- NullableBoolConverter.cs
- EntitySetDataBindingList.cs
- QilStrConcatenator.cs
- MissingSatelliteAssemblyException.cs
- WebPartCatalogCloseVerb.cs
- BamlWriter.cs
- CompositionCommandSet.cs
- SID.cs
- QueryStringParameter.cs
- LicenseManager.cs
- Localizer.cs
- XmlBinaryWriter.cs
- EntityParameter.cs
- NavigationWindow.cs
- HScrollProperties.cs
- SqlUDTStorage.cs
- DrawingContextDrawingContextWalker.cs
- ScriptManager.cs
- PageAdapter.cs
- SqlIdentifier.cs
- InkPresenter.cs
- StringExpressionSet.cs
- StateManager.cs
- WindowsAuthenticationEventArgs.cs
- CultureInfo.cs
- TypeGenericEnumerableViewSchema.cs
- ProxyWebPart.cs
- CodeCatchClauseCollection.cs
- mil_commands.cs
- DataGridItemCollection.cs
- ProgressBar.cs
- NavigationWindowAutomationPeer.cs
- BooleanFunctions.cs
- DiscreteKeyFrames.cs
- ParseNumbers.cs
- ReadWriteObjectLock.cs
- Image.cs
- BindingBase.cs
- FreezableOperations.cs
- ComplexPropertyEntry.cs
- Annotation.cs
- ExpressionBindingCollection.cs
- State.cs
- RoutingUtilities.cs
- HtmlInputImage.cs
- PropertyGrid.cs
- GenericAuthenticationEventArgs.cs
- SchemaElement.cs
- Bits.cs
- WebHostedComPlusServiceHost.cs
- KnownBoxes.cs
- FormatControl.cs
- TextElementEnumerator.cs
- TagMapInfo.cs
- ExtendedPropertyInfo.cs
- ImageSourceConverter.cs
- HashSet.cs
- DbConnectionPoolIdentity.cs
- DetailsViewDeletedEventArgs.cs
- Typography.cs
- ProgressBarRenderer.cs
- TextStore.cs
- MemoryStream.cs
- ScriptingJsonSerializationSection.cs
- MatrixKeyFrameCollection.cs
- BamlRecordReader.cs
- ManagementScope.cs
- DataGridViewRowsAddedEventArgs.cs
- XmlDocument.cs
- ChangeProcessor.cs
- CalendarDay.cs
- MessageDecoder.cs
- ReflectionPermission.cs
- IconBitmapDecoder.cs
- MdiWindowListStrip.cs
- ErrorWebPart.cs
- WebPartAuthorizationEventArgs.cs
- HtmlAnchor.cs
- ProcessRequestAsyncResult.cs