Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Util / Pair.cs / 1305376 / Pair.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System; // Generic Pair class. Overrides Equals() and GetHashCode(), so it can be used as a dictionary key. internal sealed class Pair{ private readonly TFirst _first; private readonly TSecond _second; public Pair(TFirst first, TSecond second) { _first = first; _second = second; } public TFirst First { get { return _first; } } public TSecond Second { get { return _second; } } public override bool Equals(object obj) { if (obj == this) { return true; } Pair other = obj as Pair ; return (other != null) && (((other._first == null) && (_first == null)) || ((other._first != null) && other._first.Equals(_first))) && (((other._second == null) && (_second == null)) || ((other._second != null) && other._second.Equals(_second))); } public override int GetHashCode() { int a = (_first == null) ? 0 : _first.GetHashCode(); int b = (_second == null) ? 0 : _second.GetHashCode(); return HashCodeCombiner.CombineHashCodes(a, b); } } } // 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
- _ContextAwareResult.cs
- RecipientInfo.cs
- MultipartContentParser.cs
- RadioButtonFlatAdapter.cs
- BridgeDataReader.cs
- WorkflowInstance.cs
- Sequence.cs
- ConditionalAttribute.cs
- MappingModelBuildProvider.cs
- HtmlMeta.cs
- ErrorFormatterPage.cs
- UrlMappingCollection.cs
- DataServiceQueryOfT.cs
- SmtpMail.cs
- EndpointDiscoveryElement.cs
- TypeBuilderInstantiation.cs
- RandomNumberGenerator.cs
- WebPartConnectionsEventArgs.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- BackgroundFormatInfo.cs
- AccessControlList.cs
- PenContexts.cs
- unsafenativemethodsother.cs
- WCFBuildProvider.cs
- SettingsBindableAttribute.cs
- Exceptions.cs
- SystemColors.cs
- RuntimeEnvironment.cs
- UserNameSecurityToken.cs
- connectionpool.cs
- MimePart.cs
- TaskFormBase.cs
- BitmapDownload.cs
- DataGridViewComboBoxColumn.cs
- ComNativeDescriptor.cs
- DesignerLabelAdapter.cs
- IDReferencePropertyAttribute.cs
- EdmComplexTypeAttribute.cs
- SignedXml.cs
- XmlTextWriter.cs
- StreamGeometry.cs
- ContainerParaClient.cs
- SymbolType.cs
- DrawingGroup.cs
- SoapObjectInfo.cs
- LZCodec.cs
- DataGridViewRowCancelEventArgs.cs
- WebPartExportVerb.cs
- DataControlCommands.cs
- DockPatternIdentifiers.cs
- XamlNamespaceHelper.cs
- ScriptingAuthenticationServiceSection.cs
- WebPartZoneBase.cs
- CanonicalXml.cs
- SpecialNameAttribute.cs
- WebPartEditorCancelVerb.cs
- RectangleConverter.cs
- Compiler.cs
- InstancePersistence.cs
- CircleHotSpot.cs
- NavigationProperty.cs
- CollectionBuilder.cs
- NativeMethods.cs
- LocalValueEnumerator.cs
- HttpCachePolicyBase.cs
- OrderingInfo.cs
- TextElementAutomationPeer.cs
- GrowingArray.cs
- ComponentFactoryHelpers.cs
- TextTreeRootNode.cs
- IntSecurity.cs
- DeploymentSection.cs
- SqlGenericUtil.cs
- MLangCodePageEncoding.cs
- documentation.cs
- SemanticResultKey.cs
- ProxyWebPart.cs
- CodeGenerator.cs
- PersonalizableTypeEntry.cs
- MailWriter.cs
- GatewayIPAddressInformationCollection.cs
- DesignerRegionMouseEventArgs.cs
- __Error.cs
- ResolveNameEventArgs.cs
- MemberRelationshipService.cs
- UnmanagedBitmapWrapper.cs
- BitmapEffectInput.cs
- StateInitializationDesigner.cs
- UrlAuthFailedErrorFormatter.cs
- Component.cs
- ZipFileInfoCollection.cs
- Matrix.cs
- BitmapPalettes.cs
- SplitterPanelDesigner.cs
- COM2IProvidePropertyBuilderHandler.cs
- FragmentQueryProcessor.cs
- CustomError.cs
- SrgsElementFactory.cs
- NameValuePermission.cs
- MouseGestureValueSerializer.cs