Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Collections / CompatibleComparer.cs / 1 / CompatibleComparer.cs
// Copyright (c) Microsoft Corporation. All rights reserved. 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 } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ServicePoint.cs
- ContainerFilterService.cs
- SQLByte.cs
- HostedTcpTransportManager.cs
- ParagraphResult.cs
- HwndSource.cs
- VersionedStream.cs
- HttpProfileGroupBase.cs
- TextFormattingConverter.cs
- UmAlQuraCalendar.cs
- MachineSettingsSection.cs
- TransformerConfigurationWizardBase.cs
- WebPartVerb.cs
- SQLSingleStorage.cs
- StringSource.cs
- HtmlEmptyTagControlBuilder.cs
- SimpleWebHandlerParser.cs
- XmlChildNodes.cs
- TreeNodeEventArgs.cs
- EncryptionUtility.cs
- PowerStatus.cs
- XmlQuerySequence.cs
- ConfigurationLocation.cs
- DoubleUtil.cs
- ParserContext.cs
- DoubleAnimationUsingKeyFrames.cs
- QilExpression.cs
- WindowAutomationPeer.cs
- BinaryObjectReader.cs
- AddInController.cs
- RefType.cs
- LocationReferenceValue.cs
- LeafCellTreeNode.cs
- InkCanvasInnerCanvas.cs
- InternalCompensate.cs
- TreeNodeSelectionProcessor.cs
- EndPoint.cs
- DbModificationCommandTree.cs
- CodeTypeReferenceExpression.cs
- ArglessEventHandlerProxy.cs
- DbgUtil.cs
- PreloadedPackages.cs
- KerberosTicketHashIdentifierClause.cs
- PerformanceCounters.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DemultiplexingClientMessageFormatter.cs
- CqlBlock.cs
- LiteralControl.cs
- ReferenceTypeElement.cs
- ActivityExecutorDelegateInfo.cs
- NameValueConfigurationCollection.cs
- Int16AnimationUsingKeyFrames.cs
- XNameTypeConverter.cs
- BooleanExpr.cs
- SpecularMaterial.cs
- XmlILConstructAnalyzer.cs
- CompositionAdorner.cs
- ScriptingSectionGroup.cs
- TypedCompletedAsyncResult.cs
- ProcessProtocolHandler.cs
- ObjectStateFormatter.cs
- BasicViewGenerator.cs
- FrameworkReadOnlyPropertyMetadata.cs
- MachineKey.cs
- TypeUsage.cs
- ReferentialConstraint.cs
- Int16Animation.cs
- FunctionNode.cs
- FixedSOMGroup.cs
- GroupItemAutomationPeer.cs
- TreeNodeStyle.cs
- ConstraintManager.cs
- MemberCollection.cs
- TextRangeEdit.cs
- PickBranchDesigner.xaml.cs
- SystemDiagnosticsSection.cs
- DataServiceHost.cs
- SystemDropShadowChrome.cs
- PermissionRequestEvidence.cs
- HierarchicalDataBoundControlAdapter.cs
- Helpers.cs
- ConsumerConnectionPoint.cs
- ContentHostHelper.cs
- OdbcFactory.cs
- CacheChildrenQuery.cs
- ViewStateChangedEventArgs.cs
- HttpCapabilitiesEvaluator.cs
- GeneralTransform3D.cs
- PropertyGridCommands.cs
- TcpAppDomainProtocolHandler.cs
- MemberPath.cs
- ContainerFilterService.cs
- InternalsVisibleToAttribute.cs
- RangeValidator.cs
- NullableDecimalSumAggregationOperator.cs
- SqlTypeConverter.cs
- MultiSelectRootGridEntry.cs
- CodeTypeReference.cs
- RegisteredScript.cs
- SystemIPGlobalProperties.cs