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
- ScriptingScriptResourceHandlerSection.cs
- BindingMAnagerBase.cs
- TransactionState.cs
- ObjectManager.cs
- AudienceUriMode.cs
- DiscreteKeyFrames.cs
- CodeMemberProperty.cs
- ConditionChanges.cs
- ScriptMethodAttribute.cs
- XmlSerializationReader.cs
- PropertyGroupDescription.cs
- PropertyGeneratedEventArgs.cs
- MediaPlayer.cs
- DispatcherExceptionFilterEventArgs.cs
- DrawingContextWalker.cs
- AssemblyNameEqualityComparer.cs
- COM2ExtendedTypeConverter.cs
- DrawingVisual.cs
- XmlUtf8RawTextWriter.cs
- AssemblyCollection.cs
- MarginCollapsingState.cs
- WebPartHeaderCloseVerb.cs
- ObjectCloneHelper.cs
- FrameworkElementFactory.cs
- _NegoState.cs
- XmlEncodedRawTextWriter.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- BufferedWebEventProvider.cs
- MULTI_QI.cs
- Error.cs
- DataConnectionHelper.cs
- BlockCollection.cs
- MenuItemBinding.cs
- PeerObject.cs
- WebZone.cs
- SortedDictionary.cs
- SafeFileMappingHandle.cs
- ToolboxCategory.cs
- BooleanProjectedSlot.cs
- QueueException.cs
- TargetPerspective.cs
- RequestCachePolicy.cs
- SpotLight.cs
- VisualBasicExpressionConverter.cs
- IdentityModelDictionary.cs
- HtmlButton.cs
- ValueUnavailableException.cs
- InputProviderSite.cs
- XmlSchemaAll.cs
- ScalarConstant.cs
- FixedSOMFixedBlock.cs
- SolidBrush.cs
- CapabilitiesSection.cs
- PixelFormatConverter.cs
- InstanceKeyCompleteException.cs
- QilDataSource.cs
- CodeMethodReturnStatement.cs
- XamlVector3DCollectionSerializer.cs
- CompiledQuery.cs
- XmlStreamStore.cs
- TimeStampChecker.cs
- TimeSpanValidator.cs
- BinaryObjectReader.cs
- XPathSelfQuery.cs
- FormViewDeletedEventArgs.cs
- ReadOnlyDictionary.cs
- CategoryNameCollection.cs
- PenThread.cs
- SerializationIncompleteException.cs
- SymbolPair.cs
- EnumValAlphaComparer.cs
- FusionWrap.cs
- XmlArrayItemAttributes.cs
- Set.cs
- VSWCFServiceContractGenerator.cs
- TraceListeners.cs
- InlineUIContainer.cs
- DataErrorValidationRule.cs
- DataServiceHostFactory.cs
- ListViewHitTestInfo.cs
- Convert.cs
- DBSchemaRow.cs
- DataTableReader.cs
- SQLSingle.cs
- StreamGeometry.cs
- TabItemAutomationPeer.cs
- Object.cs
- XmlSchemaComplexType.cs
- FigureParagraph.cs
- PolyBezierSegment.cs
- RoutedEventConverter.cs
- XmlAnyAttributeAttribute.cs
- RightsManagementPermission.cs
- GeometryDrawing.cs
- Stylesheet.cs
- UpdatePanelTrigger.cs
- XomlCompiler.cs
- AssemblyBuilderData.cs
- FormViewRow.cs
- NativeMethods.cs