Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / Pair.cs / 1305600 / Pair.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // Description: Pair class is useful when one needs to treat a pair of objects as a singly key in a collection. // // // History: // 08/04/2005 : mleonov - Created // //--------------------------------------------------------------------------- using System; using System.Diagnostics; namespace MS.Internal { ////// Pair class is useful when one needs to treat a pair of objects as a singly key in a collection. /// Apart from providing storage and accessors, the class forwards GetHashCode and Equals to the contained objects. /// Both object are allowed to be null. /// internal class Pair { public Pair(object first, object second) { _first = first; _second = second; } public object First { get { return _first; } } public object Second { get { return _second; } } public override int GetHashCode() { return (_first == null ? 0 : _first.GetHashCode()) ^ (_second == null ? 0 : _second.GetHashCode()); } public override bool Equals(object o) { Pair other = o as Pair; return other != null && (_first != null ? _first.Equals(other._first) : other._first == null) && (_second != null ? _second.Equals(other._second) : other._second == null); } private object _first; private object _second; } } // 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
- ConfigXmlReader.cs
- CellLabel.cs
- SystemEvents.cs
- OAVariantLib.cs
- ValidationErrorCollection.cs
- UnlockCardRequest.cs
- ChangePasswordAutoFormat.cs
- EntityTransaction.cs
- DataGridViewSortCompareEventArgs.cs
- StatusBar.cs
- InstanceDescriptor.cs
- CodeCompiler.cs
- ProxyAttribute.cs
- ReferenceTypeElement.cs
- DesignBinding.cs
- ErrorTableItemStyle.cs
- ProxyGenerator.cs
- MatrixAnimationBase.cs
- ExpressionBindingsDialog.cs
- SamlEvidence.cs
- PropertyExpression.cs
- MeasureItemEvent.cs
- FragmentNavigationEventArgs.cs
- ActivityExecutorOperation.cs
- Container.cs
- XMLSchema.cs
- TextDecoration.cs
- EmptyReadOnlyDictionaryInternal.cs
- IgnoreSection.cs
- SafeRegistryHandle.cs
- XPathMessageFilterElement.cs
- SecurityAlgorithmSuiteConverter.cs
- TypeBuilderInstantiation.cs
- XmlIlGenerator.cs
- ControlHelper.cs
- UIntPtr.cs
- SmiEventStream.cs
- Stream.cs
- BitmapFrameDecode.cs
- ThreadAbortException.cs
- EmptyStringExpandableObjectConverter.cs
- WebPartCollection.cs
- DrawingContextDrawingContextWalker.cs
- QilTypeChecker.cs
- IImplicitResourceProvider.cs
- XmlIgnoreAttribute.cs
- CustomAttributeFormatException.cs
- ExtensionSimplifierMarkupObject.cs
- RectangleGeometry.cs
- ToolStrip.cs
- XmlValueConverter.cs
- ScriptControlManager.cs
- BitmapEffectState.cs
- BoundPropertyEntry.cs
- SQLDecimal.cs
- RoleService.cs
- ModelVisual3D.cs
- StylusPointPropertyInfoDefaults.cs
- XmlSchemaException.cs
- DefaultExpressionVisitor.cs
- AttachedPropertyMethodSelector.cs
- SspiNegotiationTokenProviderState.cs
- ClientApiGenerator.cs
- MailMessage.cs
- RuntimeConfigurationRecord.cs
- GridPattern.cs
- FrameworkContentElement.cs
- BuildProvidersCompiler.cs
- FrameworkTemplate.cs
- ObsoleteAttribute.cs
- BasicBrowserDialog.cs
- DbConnectionOptions.cs
- PerformanceCounterLib.cs
- RenderTargetBitmap.cs
- SystemIPGlobalProperties.cs
- BoundColumn.cs
- UIElement3DAutomationPeer.cs
- Calendar.cs
- TextTreeTextNode.cs
- SwitchDesigner.xaml.cs
- DaylightTime.cs
- XmlBinaryReader.cs
- PointLight.cs
- Mappings.cs
- IConvertible.cs
- Blend.cs
- _HeaderInfoTable.cs
- AddInServer.cs
- BmpBitmapDecoder.cs
- DesignTimeVisibleAttribute.cs
- XPathSelfQuery.cs
- XmlEntityReference.cs
- TextRangeBase.cs
- CodeActivityMetadata.cs
- ToolStripSeparator.cs
- CounterCreationDataCollection.cs
- Size3DConverter.cs
- ColorBlend.cs
- DbSourceCommand.cs
- KeyNotFoundException.cs