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
- MsmqInputChannel.cs
- Range.cs
- BitmapInitialize.cs
- QilExpression.cs
- EditBehavior.cs
- FileBasedResourceGroveler.cs
- ObjectViewListener.cs
- SimplePropertyEntry.cs
- DiscoveryServiceExtension.cs
- BinaryReader.cs
- XmlSchemaCollection.cs
- TreeNodeClickEventArgs.cs
- Binding.cs
- AssemblyName.cs
- TypeConverterBase.cs
- EventSinkHelperWriter.cs
- XPathDocumentIterator.cs
- Symbol.cs
- ToolstripProfessionalRenderer.cs
- LogReserveAndAppendState.cs
- RepeaterCommandEventArgs.cs
- BooleanAnimationUsingKeyFrames.cs
- SmtpMail.cs
- WindowsListViewItem.cs
- CompressStream.cs
- RuleSettings.cs
- Focus.cs
- ComplexTypeEmitter.cs
- RegexMatchCollection.cs
- PassportAuthentication.cs
- CreateParams.cs
- ISAPIWorkerRequest.cs
- DataGridViewHitTestInfo.cs
- CodeComment.cs
- StreamMarshaler.cs
- RijndaelManaged.cs
- OutputCacheProfileCollection.cs
- categoryentry.cs
- MobileContainerDesigner.cs
- BooleanToVisibilityConverter.cs
- RectangleConverter.cs
- BufferedGraphics.cs
- SuppressIldasmAttribute.cs
- Roles.cs
- CacheSection.cs
- Win32.cs
- UInt16Converter.cs
- PnrpPermission.cs
- ApplicationBuildProvider.cs
- DataGridCell.cs
- FilteredDataSetHelper.cs
- Point.cs
- EmptyImpersonationContext.cs
- EncryptedKeyIdentifierClause.cs
- FormsAuthenticationCredentials.cs
- ArgumentNullException.cs
- BookmarkScopeHandle.cs
- NegatedConstant.cs
- DbQueryCommandTree.cs
- FastPropertyAccessor.cs
- HtmlInputRadioButton.cs
- WebPartConnectionsDisconnectVerb.cs
- UserNameSecurityTokenProvider.cs
- CodeAttributeArgument.cs
- _ProxyChain.cs
- WebPartConnectionsConnectVerb.cs
- QualifiedCellIdBoolean.cs
- AccessKeyManager.cs
- CapabilitiesRule.cs
- StateChangeEvent.cs
- TraceSource.cs
- RIPEMD160Managed.cs
- StrokeNodeEnumerator.cs
- EncryptedReference.cs
- ZipIOExtraFieldElement.cs
- TextElementCollectionHelper.cs
- ValuePatternIdentifiers.cs
- MissingMemberException.cs
- LinqDataSourceValidationException.cs
- SelectionProviderWrapper.cs
- ReadOnlyState.cs
- Propagator.JoinPropagator.SubstitutingCloneVisitor.cs
- AccessKeyManager.cs
- EmptyCollection.cs
- CultureInfoConverter.cs
- DataGridViewTextBoxEditingControl.cs
- EventMappingSettingsCollection.cs
- SrgsElementFactory.cs
- ReflectionTypeLoadException.cs
- ObjectDataSourceChooseMethodsPanel.cs
- SiblingIterators.cs
- NativeRightsManagementAPIsStructures.cs
- Graphics.cs
- Material.cs
- HeaderedItemsControl.cs
- CacheDependency.cs
- DrawingContextWalker.cs
- Point3DAnimation.cs
- WmiPutTraceRecord.cs
- _LoggingObject.cs