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
- DataIdProcessor.cs
- ArraySegment.cs
- Light.cs
- SystemWebSectionGroup.cs
- StreamMarshaler.cs
- ContravarianceAdapter.cs
- HttpException.cs
- XmlCodeExporter.cs
- UserControlCodeDomTreeGenerator.cs
- CodeTypeMember.cs
- AdapterDictionary.cs
- LayoutTableCell.cs
- ThreadSafeList.cs
- ExtensionElement.cs
- PropertyCollection.cs
- ConfigPathUtility.cs
- NTAccount.cs
- FixedDocument.cs
- wgx_render.cs
- Convert.cs
- MimeBasePart.cs
- CategoriesDocument.cs
- ItemsControl.cs
- IsolatedStorage.cs
- BinaryFormatterWriter.cs
- QuotaExceededException.cs
- DataServiceQueryOfT.cs
- ScriptReferenceBase.cs
- ListComponentEditorPage.cs
- DataGridViewColumnEventArgs.cs
- ParameterModifier.cs
- TryCatch.cs
- SQLMembershipProvider.cs
- NamespaceDecl.cs
- WebPartDisplayMode.cs
- WpfGeneratedKnownTypes.cs
- InteropExecutor.cs
- ISessionStateStore.cs
- SqlDelegatedTransaction.cs
- XmlElement.cs
- PointLight.cs
- TypeHelpers.cs
- XamlUtilities.cs
- DelegateTypeInfo.cs
- MemberDescriptor.cs
- MaskPropertyEditor.cs
- _CommandStream.cs
- NotConverter.cs
- ProjectionPath.cs
- ObjectFullSpanRewriter.cs
- TrustLevelCollection.cs
- SystemIcmpV6Statistics.cs
- OpacityConverter.cs
- PageAsyncTaskManager.cs
- SqlParameterizer.cs
- Vector3DCollection.cs
- RuntimeConfig.cs
- InternalException.cs
- LinqDataSourceDeleteEventArgs.cs
- FamilyMap.cs
- DocumentGrid.cs
- Invariant.cs
- SqlDataSourceView.cs
- GridItem.cs
- SqlClientPermission.cs
- OleDbDataReader.cs
- DeleteStoreRequest.cs
- ZipIOCentralDirectoryFileHeader.cs
- SByte.cs
- RequiredArgumentAttribute.cs
- WorkflowQueue.cs
- VariableAction.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- TypeListConverter.cs
- FormsAuthenticationCredentials.cs
- TargetConverter.cs
- DataGridComponentEditor.cs
- Query.cs
- XmlSchemaDocumentation.cs
- IdentityHolder.cs
- ToolStripRendererSwitcher.cs
- CompositeCollectionView.cs
- _Rfc2616CacheValidators.cs
- CrossSiteScriptingValidation.cs
- ExpressionEditorAttribute.cs
- URLString.cs
- ConstNode.cs
- shaperfactoryquerycachekey.cs
- clipboard.cs
- OdbcEnvironmentHandle.cs
- SafeCoTaskMem.cs
- NavigationExpr.cs
- XmlIncludeAttribute.cs
- IPAddress.cs
- NamespaceInfo.cs
- EndEvent.cs
- ReflectionServiceProvider.cs
- MaterialGroup.cs
- ButtonFieldBase.cs
- DrawingImage.cs