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
- FontUnit.cs
- Preprocessor.cs
- PenCursorManager.cs
- HtmlControlPersistable.cs
- SettingsPropertyValueCollection.cs
- TrailingSpaceComparer.cs
- ConfigurationStrings.cs
- DelimitedListTraceListener.cs
- QilXmlReader.cs
- SimpleApplicationHost.cs
- EntitySetBase.cs
- metadatamappinghashervisitor.cs
- ParamArrayAttribute.cs
- SequentialUshortCollection.cs
- ReadOnlyCollectionBase.cs
- BufferBuilder.cs
- XPathParser.cs
- MasterPageCodeDomTreeGenerator.cs
- SqlAliaser.cs
- TransformerConfigurationWizardBase.cs
- CodeCastExpression.cs
- DataControlCommands.cs
- SyndicationDeserializer.cs
- ReverseComparer.cs
- SapiInterop.cs
- Convert.cs
- NonDualMessageSecurityOverHttp.cs
- BigInt.cs
- OdbcError.cs
- BindingListCollectionView.cs
- ToolStripRenderEventArgs.cs
- ClosableStream.cs
- TextInfo.cs
- SHA256Managed.cs
- XmlDeclaration.cs
- RegisteredExpandoAttribute.cs
- ConfigXmlWhitespace.cs
- SvcMapFile.cs
- SiteMapSection.cs
- SmiMetaDataProperty.cs
- SelectedPathEditor.cs
- RolePrincipal.cs
- MsmqProcessProtocolHandler.cs
- SystemException.cs
- NamespaceMapping.cs
- ResolveRequestResponseAsyncResult.cs
- StrongNameIdentityPermission.cs
- WebPartDescriptionCollection.cs
- DataColumnChangeEvent.cs
- XmlDataSource.cs
- NavigationProperty.cs
- CacheModeValueSerializer.cs
- WebPartEditorOkVerb.cs
- MenuItemStyleCollection.cs
- HtmlContainerControl.cs
- PageThemeBuildProvider.cs
- DataGridViewCellConverter.cs
- AttachedPropertyMethodSelector.cs
- OperationCanceledException.cs
- State.cs
- Thread.cs
- Pkcs7Recipient.cs
- PropagatorResult.cs
- ToolboxItem.cs
- HashJoinQueryOperatorEnumerator.cs
- HttpEncoder.cs
- ButtonField.cs
- Choices.cs
- StrokeFIndices.cs
- PagePropertiesChangingEventArgs.cs
- AttributeAction.cs
- FamilyMap.cs
- EditorZoneBase.cs
- ClientConvert.cs
- HttpContext.cs
- SmtpAuthenticationManager.cs
- ListView.cs
- RijndaelManagedTransform.cs
- METAHEADER.cs
- QuaternionRotation3D.cs
- HttpResponseWrapper.cs
- TextParaClient.cs
- Internal.cs
- CapabilitiesAssignment.cs
- TypedTableBaseExtensions.cs
- HostExecutionContextManager.cs
- ConfigXmlText.cs
- OAVariantLib.cs
- Vector3DValueSerializer.cs
- ImageClickEventArgs.cs
- SettingsPropertyWrongTypeException.cs
- DrawingVisualDrawingContext.cs
- DataStorage.cs
- SimpleNameService.cs
- SimpleTextLine.cs
- SizeAnimationBase.cs
- DataPager.cs
- Aggregates.cs
- CopyOfAction.cs
- GenericParameterDataContract.cs