Code:
/ FX-1434 / FX-1434 / 1.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
- ViewLoader.cs
- Debugger.cs
- IssuanceTokenProviderBase.cs
- MeshGeometry3D.cs
- SafeHGlobalHandleCritical.cs
- VirtualizingStackPanel.cs
- CanonicalXml.cs
- DockProviderWrapper.cs
- StylusPointPropertyId.cs
- Matrix.cs
- DecimalAnimation.cs
- TextContainerChangedEventArgs.cs
- HostExecutionContextManager.cs
- DataPager.cs
- DataTableNewRowEvent.cs
- ProcessInfo.cs
- ProfessionalColors.cs
- Vector3D.cs
- DataBoundControl.cs
- ProcessHostMapPath.cs
- AggregateNode.cs
- ClientRuntimeConfig.cs
- WebScriptMetadataMessageEncoderFactory.cs
- CodeMethodInvokeExpression.cs
- UInt32Storage.cs
- XmlSchemaIdentityConstraint.cs
- GraphicsState.cs
- ConfigurationSectionGroup.cs
- ReaderOutput.cs
- EdmComplexTypeAttribute.cs
- ExpandedWrapper.cs
- StrongNameIdentityPermission.cs
- ColorMatrix.cs
- PropertyTabChangedEvent.cs
- StringUtil.cs
- JoinGraph.cs
- DataGridViewCellStateChangedEventArgs.cs
- TypeUsageBuilder.cs
- HorizontalAlignConverter.cs
- MenuItemBindingCollection.cs
- Table.cs
- _ChunkParse.cs
- AllMembershipCondition.cs
- MultipartContentParser.cs
- CreatingCookieEventArgs.cs
- FileUtil.cs
- SettingsPropertyWrongTypeException.cs
- ProxyWebPartConnectionCollection.cs
- OutputCacheSection.cs
- IMembershipProvider.cs
- SymbolType.cs
- XamlInt32CollectionSerializer.cs
- XmlCustomFormatter.cs
- DataMemberConverter.cs
- CqlParserHelpers.cs
- GeneralTransform2DTo3D.cs
- Comparer.cs
- LongValidatorAttribute.cs
- StreamWithDictionary.cs
- ColumnHeaderCollectionEditor.cs
- EventPrivateKey.cs
- SizeIndependentAnimationStorage.cs
- BasicSecurityProfileVersion.cs
- DateTimeValueSerializer.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ResourceReferenceExpression.cs
- PrintControllerWithStatusDialog.cs
- GroupJoinQueryOperator.cs
- BuildProviderCollection.cs
- WebAdminConfigurationHelper.cs
- IdSpace.cs
- AttachInfo.cs
- XmlTypeAttribute.cs
- ResolveCriteriaApril2005.cs
- SudsParser.cs
- initElementDictionary.cs
- Random.cs
- TextLineResult.cs
- CodeMethodInvokeExpression.cs
- HandleRef.cs
- WebPartDisplayModeCollection.cs
- CodeCommentStatement.cs
- QueryOperatorEnumerator.cs
- HtmlWindowCollection.cs
- FixedFindEngine.cs
- XmlSchemaElement.cs
- SQLInt16.cs
- Processor.cs
- ElementNotAvailableException.cs
- EntityDataSourceColumn.cs
- SetterBase.cs
- DesignTimeTemplateParser.cs
- EtwTrace.cs
- StrongNameUtility.cs
- EntityCommandCompilationException.cs
- XslAst.cs
- ColorConverter.cs
- X509Extension.cs
- ObjectPersistData.cs
- GridViewCommandEventArgs.cs