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
- ActionFrame.cs
- NotSupportedException.cs
- TextDocumentView.cs
- LocationEnvironment.cs
- LexicalChunk.cs
- DataBoundControl.cs
- SchemaImporterExtensionElement.cs
- SystemBrushes.cs
- SrgsElement.cs
- InlineCategoriesDocument.cs
- x509utils.cs
- RoutedEventValueSerializer.cs
- FileSystemWatcher.cs
- NullRuntimeConfig.cs
- InvalidComObjectException.cs
- VersionedStream.cs
- Image.cs
- AccessDataSource.cs
- SqlCacheDependencyDatabaseCollection.cs
- SoapSchemaMember.cs
- DocumentReference.cs
- CqlGenerator.cs
- DocumentApplication.cs
- DPAPIProtectedConfigurationProvider.cs
- ActiveXHelper.cs
- TableLayoutStyle.cs
- AlphaSortedEnumConverter.cs
- NameValuePermission.cs
- BrushConverter.cs
- ConfigXmlWhitespace.cs
- EpmAttributeNameBuilder.cs
- RegexTree.cs
- ICspAsymmetricAlgorithm.cs
- SchemaImporterExtension.cs
- CodeIterationStatement.cs
- GridLength.cs
- TextEffect.cs
- RuleConditionDialog.cs
- PartialClassGenerationTaskInternal.cs
- RectangleGeometry.cs
- ListViewItemMouseHoverEvent.cs
- Rect3D.cs
- Token.cs
- LambdaCompiler.cs
- InputScope.cs
- Rect3D.cs
- QueryParameter.cs
- TypeConverterHelper.cs
- MulticastDelegate.cs
- XmlDictionary.cs
- TypeDelegator.cs
- XmlSchemaSubstitutionGroup.cs
- Converter.cs
- HttpServerVarsCollection.cs
- SmtpReplyReader.cs
- MetadataSource.cs
- UIntPtr.cs
- DesignerView.cs
- SplitterPanel.cs
- PersonalizableAttribute.cs
- MultiTrigger.cs
- InvalidPrinterException.cs
- EditorBrowsableAttribute.cs
- sqlnorm.cs
- X509ChainElement.cs
- Action.cs
- HttpInputStream.cs
- RootAction.cs
- MethodAccessException.cs
- LocalClientSecuritySettings.cs
- FlowLayout.cs
- CodeDirectiveCollection.cs
- KeyConverter.cs
- StringWriter.cs
- BitmapCodecInfoInternal.cs
- WpfXamlMember.cs
- ServiceDeploymentInfo.cs
- RectValueSerializer.cs
- ModelItem.cs
- Enlistment.cs
- InstanceLockQueryResult.cs
- RecordConverter.cs
- Assert.cs
- MenuCommand.cs
- FilterableData.cs
- VerbConverter.cs
- EnumBuilder.cs
- XmlTypeMapping.cs
- ImageClickEventArgs.cs
- ReadOnlyNameValueCollection.cs
- XPathNodeIterator.cs
- StyleModeStack.cs
- AuthenticatingEventArgs.cs
- ComponentGuaranteesAttribute.cs
- TreeIterator.cs
- OperationContextScope.cs
- SQLDoubleStorage.cs
- ParenExpr.cs
- Point3DValueSerializer.cs
- HttpStreamMessage.cs