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
- PropertyValueChangedEvent.cs
- MenuRenderer.cs
- AuthenticationServiceManager.cs
- InternalBufferManager.cs
- ColorConverter.cs
- InstanceDescriptor.cs
- PerformanceCounterPermissionEntry.cs
- RegexWorker.cs
- M3DUtil.cs
- DropDownButton.cs
- XmlMembersMapping.cs
- LineGeometry.cs
- WindowsListView.cs
- UrlMapping.cs
- WebPartEditorApplyVerb.cs
- ZipIOExtraFieldPaddingElement.cs
- ConfigXmlWhitespace.cs
- TrustLevelCollection.cs
- PersonalizationAdministration.cs
- ReflectionUtil.cs
- Item.cs
- XDeferredAxisSource.cs
- CodeIterationStatement.cs
- BinaryNode.cs
- XmlnsCompatibleWithAttribute.cs
- IPipelineRuntime.cs
- SupportsEventValidationAttribute.cs
- OleDbSchemaGuid.cs
- SerializationFieldInfo.cs
- Application.cs
- DataContractSet.cs
- ProxyWebPartManager.cs
- SqlRowUpdatedEvent.cs
- PropertyMetadata.cs
- CompiledRegexRunnerFactory.cs
- datacache.cs
- CodeCommentStatementCollection.cs
- OpenFileDialog.cs
- EventLogPermissionAttribute.cs
- TimersDescriptionAttribute.cs
- SmiContextFactory.cs
- SqlWebEventProvider.cs
- DrawToolTipEventArgs.cs
- PagePropertiesChangingEventArgs.cs
- FileDataSourceCache.cs
- DateTimeFormat.cs
- DataGridPageChangedEventArgs.cs
- SoapIgnoreAttribute.cs
- XslAstAnalyzer.cs
- MaterialCollection.cs
- ObjectTag.cs
- SimpleType.cs
- SQLDecimalStorage.cs
- Rights.cs
- ProcessHostFactoryHelper.cs
- LinqDataSourceDeleteEventArgs.cs
- ParameterBuilder.cs
- AttributeQuery.cs
- ConsoleKeyInfo.cs
- ObjectQuery.cs
- BezierSegment.cs
- ASCIIEncoding.cs
- DataGridViewLayoutData.cs
- MetadataCache.cs
- _BasicClient.cs
- PartitionedDataSource.cs
- SafeEventHandle.cs
- RegexFCD.cs
- VirtualPath.cs
- Module.cs
- CollectionTypeElement.cs
- SqlFactory.cs
- followingquery.cs
- DataListItem.cs
- SettingsPropertyValueCollection.cs
- LineInfo.cs
- FixUp.cs
- TypeUsage.cs
- SelectionItemPattern.cs
- OleDbTransaction.cs
- DataGridItemEventArgs.cs
- DynamicDataResources.Designer.cs
- InfoCardKeyedHashAlgorithm.cs
- IItemContainerGenerator.cs
- TrackingAnnotationCollection.cs
- TextEditorDragDrop.cs
- PriorityRange.cs
- MenuScrollingVisibilityConverter.cs
- LexicalChunk.cs
- InputScopeNameConverter.cs
- ScriptManager.cs
- BuildProvider.cs
- GridLength.cs
- DataMemberListEditor.cs
- base64Transforms.cs
- DataServiceRequest.cs
- OleDbConnectionInternal.cs
- HotSpot.cs
- TriggerBase.cs
- ScriptingJsonSerializationSection.cs