Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Shared / MS / Internal / Pair.cs / 1 / 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 : [....] - 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NameTable.cs
- SchemaElementDecl.cs
- grammarelement.cs
- BezierSegment.cs
- AttributeProviderAttribute.cs
- XmlDesignerDataSourceView.cs
- infer.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- RtfFormatStack.cs
- ZoneButton.cs
- PointAnimationUsingKeyFrames.cs
- RoutedEventArgs.cs
- StateManagedCollection.cs
- DocumentViewerHelper.cs
- StateChangeEvent.cs
- Matrix3D.cs
- Literal.cs
- EventProviderBase.cs
- XPathNodePointer.cs
- RealProxy.cs
- ControlUtil.cs
- FlowThrottle.cs
- DrawingGroup.cs
- CorrelationScope.cs
- SemanticResolver.cs
- DetailsViewPageEventArgs.cs
- Int32Rect.cs
- TypeBrowser.xaml.cs
- TextParagraphCache.cs
- HiddenFieldPageStatePersister.cs
- StringDictionary.cs
- UInt64.cs
- SelectionUIHandler.cs
- ToolStripItem.cs
- ToolStripDropTargetManager.cs
- HttpModuleAction.cs
- Header.cs
- IDReferencePropertyAttribute.cs
- PasswordPropertyTextAttribute.cs
- Base64Encoder.cs
- EntityDescriptor.cs
- SoapReflectionImporter.cs
- MetadataPropertyCollection.cs
- DependencyPropertyHelper.cs
- CodeStatement.cs
- TitleStyle.cs
- RSAProtectedConfigurationProvider.cs
- MailWebEventProvider.cs
- TextViewBase.cs
- CharKeyFrameCollection.cs
- Base64Encoder.cs
- OpenTypeLayout.cs
- ToolStripOverflow.cs
- TreeNodeBinding.cs
- NameValuePermission.cs
- BaseDataBoundControlDesigner.cs
- WhitespaceRuleLookup.cs
- TextParagraphView.cs
- DateTimeFormat.cs
- TypedDataSetSchemaImporterExtension.cs
- DependentList.cs
- BindingValueChangedEventArgs.cs
- XPathAncestorQuery.cs
- TextTreeTextNode.cs
- EventProxy.cs
- CompiledAction.cs
- FunctionCommandText.cs
- ArrayWithOffset.cs
- Math.cs
- ValidatorUtils.cs
- ListViewGroupCollectionEditor.cs
- HotSpotCollection.cs
- BitmapEffectGroup.cs
- AttributeExtensions.cs
- XmlProcessingInstruction.cs
- NativeMethods.cs
- EditCommandColumn.cs
- HttpListenerResponse.cs
- RulePatternOps.cs
- EndCreateSecurityTokenRequest.cs
- Visual3D.cs
- FixedSOMGroup.cs
- PageContent.cs
- EntityObject.cs
- Double.cs
- brushes.cs
- XpsFilter.cs
- SimplePropertyEntry.cs
- NetTcpBindingElement.cs
- DataTransferEventArgs.cs
- XmlObjectSerializerContext.cs
- ModulesEntry.cs
- XmlTextAttribute.cs
- DialogResultConverter.cs
- IList.cs
- LabelEditEvent.cs
- TextMarkerSource.cs
- KeyGestureValueSerializer.cs
- SqlHelper.cs
- AutomationAttributeInfo.cs