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
- DataGridViewCellParsingEventArgs.cs
- MatrixTransform3D.cs
- FormViewInsertedEventArgs.cs
- x509utils.cs
- TableMethodGenerator.cs
- StreamedWorkflowDefinitionContext.cs
- ConnectionManager.cs
- RuntimeConfigLKG.cs
- TileBrush.cs
- documentsequencetextpointer.cs
- ResourceExpressionBuilder.cs
- Int16Animation.cs
- UIElementParagraph.cs
- ConnectionStringSettings.cs
- ConnectionProviderAttribute.cs
- DeviceContext2.cs
- Screen.cs
- BitmapCodecInfoInternal.cs
- RijndaelManaged.cs
- ProviderUtil.cs
- EmbeddedObject.cs
- BindingSource.cs
- ScriptModule.cs
- NamespaceQuery.cs
- XamlInt32CollectionSerializer.cs
- MetadataAssemblyHelper.cs
- AccessKeyManager.cs
- ByteConverter.cs
- QueryStringParameter.cs
- InputLanguageProfileNotifySink.cs
- Merger.cs
- RegistrySecurity.cs
- OleDbMetaDataFactory.cs
- OutputCacheProfile.cs
- XmlSchemaSimpleType.cs
- Roles.cs
- Error.cs
- FolderNameEditor.cs
- ParserHooks.cs
- ExclusiveHandle.cs
- RootCodeDomSerializer.cs
- LinearGradientBrush.cs
- WebPartCloseVerb.cs
- XmlDictionaryWriter.cs
- SecurityChannel.cs
- SafeTokenHandle.cs
- DebugHandleTracker.cs
- CorrelationManager.cs
- TcpHostedTransportConfiguration.cs
- ValidationHelper.cs
- MatrixKeyFrameCollection.cs
- DataAdapter.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- TabControl.cs
- VersionUtil.cs
- DetailsViewUpdatedEventArgs.cs
- SerializationInfo.cs
- GPRECTF.cs
- StretchValidation.cs
- QilReplaceVisitor.cs
- DataGridViewColumnCollection.cs
- StylusSystemGestureEventArgs.cs
- HtmlEmptyTagControlBuilder.cs
- ParameterElement.cs
- DataSourceGeneratorException.cs
- SharedPersonalizationStateInfo.cs
- RequestNavigateEventArgs.cs
- RTLAwareMessageBox.cs
- EUCJPEncoding.cs
- DragDrop.cs
- DBDataPermission.cs
- NavigationEventArgs.cs
- CultureInfoConverter.cs
- QilInvokeEarlyBound.cs
- MsmqAppDomainProtocolHandler.cs
- ResXResourceSet.cs
- __FastResourceComparer.cs
- DoubleCollectionValueSerializer.cs
- ProviderException.cs
- FilteredDataSetHelper.cs
- Group.cs
- LayoutExceptionEventArgs.cs
- PathSegmentCollection.cs
- PersonalizationEntry.cs
- PathFigureCollection.cs
- UriTemplateMatchException.cs
- PropertyTabChangedEvent.cs
- SingleSelectRootGridEntry.cs
- DoubleIndependentAnimationStorage.cs
- DocumentXPathNavigator.cs
- DataGridViewTextBoxEditingControl.cs
- DataGrid.cs
- KerberosSecurityTokenProvider.cs
- TransformGroup.cs
- RawTextInputReport.cs
- BufferedGraphics.cs
- DataTableNewRowEvent.cs
- ProcessInfo.cs
- Shared.cs
- ObjectItemNoOpAssemblyLoader.cs