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
- StructuredTypeEmitter.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- DoubleAnimationBase.cs
- ConfigurationLockCollection.cs
- JapaneseCalendar.cs
- PeerToPeerException.cs
- TextBlockAutomationPeer.cs
- ellipse.cs
- Partitioner.cs
- EditorAttribute.cs
- InkPresenterAutomationPeer.cs
- DoubleUtil.cs
- _SingleItemRequestCache.cs
- webeventbuffer.cs
- HttpCapabilitiesBase.cs
- PanelStyle.cs
- EndPoint.cs
- BaseParagraph.cs
- SQLConvert.cs
- AssociationType.cs
- ServerValidateEventArgs.cs
- CompositeControl.cs
- TreeNodeConverter.cs
- FormViewUpdateEventArgs.cs
- HighlightComponent.cs
- UseLicense.cs
- PathFigureCollectionValueSerializer.cs
- ButtonField.cs
- DelegateSerializationHolder.cs
- shaperfactoryquerycacheentry.cs
- DataServiceHost.cs
- EmbeddedMailObject.cs
- ListViewInsertEventArgs.cs
- Button.cs
- IntPtr.cs
- FactoryId.cs
- GeneratedCodeAttribute.cs
- ToggleButton.cs
- MsmqElementBase.cs
- SystemDiagnosticsSection.cs
- MailBnfHelper.cs
- ToolStripDropDownClosedEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- XPathBinder.cs
- SecurityTokenRequirement.cs
- contentDescriptor.cs
- BitmapEffectGroup.cs
- DataGridViewImageColumn.cs
- Compilation.cs
- OutputCacheSection.cs
- SubtreeProcessor.cs
- DynamicResourceExtension.cs
- DockAndAnchorLayout.cs
- BuildResultCache.cs
- PageTheme.cs
- ToolStripLabel.cs
- InlinedAggregationOperatorEnumerator.cs
- TiffBitmapDecoder.cs
- SynchronizedPool.cs
- Privilege.cs
- Cursor.cs
- x509utils.cs
- ControlPropertyNameConverter.cs
- ResXBuildProvider.cs
- ToolStripTextBox.cs
- TableColumn.cs
- EpmContentDeSerializerBase.cs
- VerificationAttribute.cs
- Domain.cs
- BrushValueSerializer.cs
- FixedLineResult.cs
- CustomAttributeFormatException.cs
- CachedTypeface.cs
- UrlSyndicationContent.cs
- MatcherBuilder.cs
- ExpressionBuilderContext.cs
- XPathExpr.cs
- ManagementObjectCollection.cs
- DataRecordInternal.cs
- PolicyLevel.cs
- FormatSettings.cs
- StylusTip.cs
- DataGridViewCellPaintingEventArgs.cs
- CrossAppDomainChannel.cs
- CommentAction.cs
- GifBitmapEncoder.cs
- AbstractExpressions.cs
- PageCatalogPartDesigner.cs
- ArrayTypeMismatchException.cs
- SystemKeyConverter.cs
- BitmapSourceSafeMILHandle.cs
- CodeDomComponentSerializationService.cs
- util.cs
- PrimitiveXmlSerializers.cs
- Convert.cs
- ListViewItemSelectionChangedEvent.cs
- XslAst.cs
- CodeDOMUtility.cs
- ColorMatrix.cs
- LocatorPartList.cs