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
- GuidelineCollection.cs
- TemplateField.cs
- PictureBoxDesigner.cs
- WmlImageAdapter.cs
- SQLDoubleStorage.cs
- CompiledQueryCacheEntry.cs
- SettingsBase.cs
- x509utils.cs
- RtType.cs
- SystemInfo.cs
- DrawListViewSubItemEventArgs.cs
- Wizard.cs
- EntityClassGenerator.cs
- WeakEventManager.cs
- InOutArgument.cs
- ScriptServiceAttribute.cs
- PerformanceCounterPermissionEntryCollection.cs
- SuppressMessageAttribute.cs
- WebPartTransformerAttribute.cs
- MSG.cs
- GlyphRunDrawing.cs
- DetailsViewAutoFormat.cs
- PolyLineSegmentFigureLogic.cs
- ImageAutomationPeer.cs
- HostExecutionContextManager.cs
- ClassDataContract.cs
- IdentityReference.cs
- Compiler.cs
- brushes.cs
- SmtpFailedRecipientsException.cs
- XmlReaderSettings.cs
- KeyValuePairs.cs
- IsolatedStorageFilePermission.cs
- COM2IDispatchConverter.cs
- Helpers.cs
- Visitors.cs
- BamlLocalizationDictionary.cs
- AdjustableArrowCap.cs
- XmlSerializerFactory.cs
- DecoratedNameAttribute.cs
- DoubleAnimationBase.cs
- Soap12ProtocolImporter.cs
- MatchNoneMessageFilter.cs
- WebBrowserNavigatingEventHandler.cs
- ComponentRenameEvent.cs
- AppDomainResourcePerfCounters.cs
- GetResponse.cs
- DateTimePickerDesigner.cs
- SecurityDescriptor.cs
- SystemDiagnosticsSection.cs
- SafeProcessHandle.cs
- DataTableReaderListener.cs
- ColumnProvider.cs
- Decorator.cs
- ObjectDataProvider.cs
- NativeMethods.cs
- GridViewSelectEventArgs.cs
- TrackingCondition.cs
- DecimalConverter.cs
- XmlTypeMapping.cs
- ImageIndexConverter.cs
- QilTypeChecker.cs
- CodeAttributeDeclaration.cs
- ProjectionPathBuilder.cs
- BoundsDrawingContextWalker.cs
- MediaEntryAttribute.cs
- SqlTrackingService.cs
- ISFClipboardData.cs
- WebReferencesBuildProvider.cs
- HashHelper.cs
- MembershipValidatePasswordEventArgs.cs
- ResourceManagerWrapper.cs
- TabPanel.cs
- NullableDoubleSumAggregationOperator.cs
- SmtpReplyReader.cs
- Propagator.JoinPropagator.cs
- Identity.cs
- AccessedThroughPropertyAttribute.cs
- MailHeaderInfo.cs
- ReflectEventDescriptor.cs
- OperationContractGenerationContext.cs
- SqlProfileProvider.cs
- ListControlBuilder.cs
- AnnotationResourceChangedEventArgs.cs
- RestHandler.cs
- BindingMemberInfo.cs
- ReflectTypeDescriptionProvider.cs
- ModelItemExtensions.cs
- invalidudtexception.cs
- WindowPatternIdentifiers.cs
- StringComparer.cs
- QueryExtender.cs
- WebConfigurationHostFileChange.cs
- OdbcConnectionPoolProviderInfo.cs
- ImageButton.cs
- CheckBoxField.cs
- CorrelationTokenInvalidatedHandler.cs
- FixedTextView.cs
- ValueType.cs
- _DynamicWinsockMethods.cs