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
- GorillaCodec.cs
- CornerRadius.cs
- AsymmetricSecurityProtocol.cs
- AppModelKnownContentFactory.cs
- StdValidatorsAndConverters.cs
- MailWriter.cs
- ColorTypeConverter.cs
- TextBoxBase.cs
- ContractUtils.cs
- XPathNodeHelper.cs
- QilVisitor.cs
- XhtmlBasicCalendarAdapter.cs
- CodeDomLoader.cs
- CodeCastExpression.cs
- ComPlusTypeValidator.cs
- sqlstateclientmanager.cs
- ByteAnimation.cs
- Mapping.cs
- QueryContinueDragEventArgs.cs
- Trace.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- Tablet.cs
- CqlBlock.cs
- CheckBox.cs
- EditorZoneDesigner.cs
- ListView.cs
- InternalEnumValidator.cs
- HttpClientCertificate.cs
- FormDesigner.cs
- ToolStripControlHost.cs
- BinaryReader.cs
- EventLog.cs
- loginstatus.cs
- CellLabel.cs
- HiddenFieldPageStatePersister.cs
- LassoHelper.cs
- TreeNodeCollectionEditor.cs
- GC.cs
- RenderOptions.cs
- AssemblyNameProxy.cs
- ObjectHelper.cs
- Matrix3D.cs
- ListBoxItemAutomationPeer.cs
- NativeRecognizer.cs
- InputReportEventArgs.cs
- WebPartActionVerb.cs
- DataListItem.cs
- MachineKeySection.cs
- WaitingCursor.cs
- XsltOutput.cs
- SerializationObjectManager.cs
- SubMenuStyleCollection.cs
- WmlPanelAdapter.cs
- LassoHelper.cs
- PrimitiveType.cs
- MenuEventArgs.cs
- SqlBuilder.cs
- CommandCollectionEditor.cs
- SystemException.cs
- HyperlinkAutomationPeer.cs
- DnsPermission.cs
- Predicate.cs
- DecoderReplacementFallback.cs
- WebPartMinimizeVerb.cs
- WpfXamlMember.cs
- TextPointerBase.cs
- PathGeometry.cs
- RepeaterDesigner.cs
- FileNotFoundException.cs
- LineServicesCallbacks.cs
- AppSettingsSection.cs
- AuthenticatedStream.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- RelationshipNavigation.cs
- BamlBinaryReader.cs
- TokenBasedSetEnumerator.cs
- EmptyEnumerator.cs
- SchemaImporterExtensionsSection.cs
- AllMembershipCondition.cs
- GenericTypeParameterConverter.cs
- XMLUtil.cs
- XmlAttributeCollection.cs
- Parser.cs
- DesignerFrame.cs
- WindowCollection.cs
- SystemIPInterfaceProperties.cs
- HandlerMappingMemo.cs
- WindowsComboBox.cs
- TextCharacters.cs
- ObjectDataSourceFilteringEventArgs.cs
- AutoResetEvent.cs
- messageonlyhwndwrapper.cs
- ValidationRuleCollection.cs
- HtmlTableRowCollection.cs
- XmlRawWriter.cs
- RedBlackList.cs
- COM2FontConverter.cs
- SystemSounds.cs
- ExpressionCopier.cs
- XPathSingletonIterator.cs