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
- DesignerDataParameter.cs
- ObjectIDGenerator.cs
- HandlerMappingMemo.cs
- MasterPageParser.cs
- DateRangeEvent.cs
- DataGridViewColumnCollection.cs
- ListItem.cs
- Message.cs
- LiteralSubsegment.cs
- EncodingConverter.cs
- WebReferencesBuildProvider.cs
- BCLDebug.cs
- PropertyGridEditorPart.cs
- ProcessingInstructionAction.cs
- MenuItemCollection.cs
- BrowserInteropHelper.cs
- _TimerThread.cs
- TextSpan.cs
- ProtocolViolationException.cs
- XmlCDATASection.cs
- Pair.cs
- PropertySourceInfo.cs
- TypeLoadException.cs
- MetadataArtifactLoaderComposite.cs
- ContractsBCL.cs
- DynamicMetaObjectBinder.cs
- DependencyObject.cs
- RunWorkerCompletedEventArgs.cs
- SubtreeProcessor.cs
- TileModeValidation.cs
- CompositeScriptReferenceEventArgs.cs
- ModulesEntry.cs
- Freezable.cs
- EntryPointNotFoundException.cs
- UpdatePanelTriggerCollection.cs
- ComboBoxAutomationPeer.cs
- MarkupExtensionParser.cs
- PropertyIDSet.cs
- CharStorage.cs
- CompilerParameters.cs
- CroppedBitmap.cs
- ErrorHandler.cs
- MonthChangedEventArgs.cs
- RecipientInfo.cs
- ISessionStateStore.cs
- CachedBitmap.cs
- TextView.cs
- SqlSupersetValidator.cs
- DetailsViewPagerRow.cs
- SafeIUnknown.cs
- UserControl.cs
- ProxyOperationRuntime.cs
- ConfigXmlAttribute.cs
- Completion.cs
- SkipQueryOptionExpression.cs
- TemplateControlParser.cs
- ButtonPopupAdapter.cs
- DocumentPaginator.cs
- GACIdentityPermission.cs
- securitymgrsite.cs
- ResXFileRef.cs
- DataGridViewColumnDesigner.cs
- SemanticKeyElement.cs
- UInt16Converter.cs
- EntityTransaction.cs
- DocumentPageTextView.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- TextParaClient.cs
- SlotInfo.cs
- ApplicationBuildProvider.cs
- PeerName.cs
- RangeExpression.cs
- FacetChecker.cs
- CryptoHandle.cs
- EventLogSession.cs
- PrimitiveXmlSerializers.cs
- SystemWebSectionGroup.cs
- Debug.cs
- Pair.cs
- LinqDataSourceSelectEventArgs.cs
- WebEvents.cs
- listitem.cs
- ColumnBinding.cs
- DataMemberFieldEditor.cs
- ProviderException.cs
- AnyReturnReader.cs
- XmlWellformedWriter.cs
- DataGridViewBand.cs
- GeneralTransformGroup.cs
- Schema.cs
- IPAddress.cs
- ISAPIRuntime.cs
- Visitor.cs
- UrlAuthorizationModule.cs
- MetaModel.cs
- UInt64.cs
- EntityDataSourceView.cs
- BindToObject.cs
- DetailsViewPageEventArgs.cs
- GenericRootAutomationPeer.cs