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
- WorkflowTimerService.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- SmtpException.cs
- XmlWriterSettings.cs
- SQLString.cs
- WmlLinkAdapter.cs
- SpecialNameAttribute.cs
- AudienceUriMode.cs
- OleDbDataAdapter.cs
- UrlMappingsModule.cs
- OdbcParameter.cs
- FactoryMaker.cs
- ExtentKey.cs
- StatusBar.cs
- DecoderExceptionFallback.cs
- Typography.cs
- ResponseStream.cs
- HttpServerVarsCollection.cs
- PeekCompletedEventArgs.cs
- PropertyEntry.cs
- ListViewGroupItemCollection.cs
- DataGridHelper.cs
- WaitHandle.cs
- DisplayInformation.cs
- DataKeyArray.cs
- StorageTypeMapping.cs
- SiteMapNodeItemEventArgs.cs
- XmlSerializerNamespaces.cs
- WebBaseEventKeyComparer.cs
- WebServiceMethodData.cs
- XmlDataDocument.cs
- SamlAssertionKeyIdentifierClause.cs
- Membership.cs
- _TimerThread.cs
- DynamicILGenerator.cs
- MarkupExtensionSerializer.cs
- SQLUtility.cs
- Span.cs
- LabelAutomationPeer.cs
- AuthenticationModeHelper.cs
- HttpRequestCacheValidator.cs
- SaveFileDialog.cs
- MasterPageBuildProvider.cs
- ChannelManager.cs
- DefaultParameterValueAttribute.cs
- NullExtension.cs
- RowsCopiedEventArgs.cs
- RichTextBoxConstants.cs
- CatalogZoneBase.cs
- ICspAsymmetricAlgorithm.cs
- EventItfInfo.cs
- SystemIPv4InterfaceProperties.cs
- LinqTreeNodeEvaluator.cs
- SaveRecipientRequest.cs
- FormattedTextSymbols.cs
- PartitionResolver.cs
- TabPage.cs
- BamlReader.cs
- XslNumber.cs
- ControlBuilder.cs
- HitTestParameters3D.cs
- Selection.cs
- HttpPostServerProtocol.cs
- EnvelopedPkcs7.cs
- MultiAsyncResult.cs
- DataGridDetailsPresenterAutomationPeer.cs
- DerivedKeyCachingSecurityTokenSerializer.cs
- ASCIIEncoding.cs
- HintTextConverter.cs
- DispatcherObject.cs
- RegexCompilationInfo.cs
- DataKey.cs
- StackSpiller.Bindings.cs
- MetadataItemSerializer.cs
- DerivedKeySecurityToken.cs
- LiteralText.cs
- OutgoingWebRequestContext.cs
- DataContractAttribute.cs
- BookmarkScopeHandle.cs
- TextFindEngine.cs
- XmlIlTypeHelper.cs
- PrintingPermission.cs
- ConvertersCollection.cs
- BamlLocalizer.cs
- EnumDataContract.cs
- SignatureDescription.cs
- WebPartConnectionsConnectVerb.cs
- XmlSerializationWriter.cs
- CodeLinePragma.cs
- DependencySource.cs
- Propagator.Evaluator.cs
- StrokeDescriptor.cs
- EdmValidator.cs
- AbstractSvcMapFileLoader.cs
- TextRunCache.cs
- EventLogHandle.cs
- FunctionQuery.cs
- StatusBarItemAutomationPeer.cs
- NullReferenceException.cs
- OdbcTransaction.cs