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
- HttpConfigurationSystem.cs
- TransformedBitmap.cs
- Row.cs
- HttpCapabilitiesEvaluator.cs
- DefaultValueTypeConverter.cs
- BitmapCacheBrush.cs
- FixedDocumentSequencePaginator.cs
- XmlDataSourceDesigner.cs
- Brushes.cs
- Properties.cs
- QuotedStringFormatReader.cs
- XmlSchemaDocumentation.cs
- QueryParameter.cs
- TdsParserSessionPool.cs
- XmlWrappingReader.cs
- SynchronousChannelMergeEnumerator.cs
- ShaperBuffers.cs
- List.cs
- IPAddressCollection.cs
- Timeline.cs
- SqlUserDefinedTypeAttribute.cs
- InkCanvas.cs
- InputProcessorProfiles.cs
- NullEntityWrapper.cs
- HtmlControl.cs
- BitmapEffectRenderDataResource.cs
- SizeFConverter.cs
- LicFileLicenseProvider.cs
- Object.cs
- RoleGroup.cs
- AccessDataSource.cs
- CompilerScopeManager.cs
- SqlWebEventProvider.cs
- StructuralComparisons.cs
- WebScriptServiceHost.cs
- HttpRawResponse.cs
- ArrayList.cs
- AppDomainProtocolHandler.cs
- MeasurementDCInfo.cs
- DataGridColumnDropSeparator.cs
- MergePropertyDescriptor.cs
- DefaultExpression.cs
- HttpCachePolicy.cs
- XamlReader.cs
- SerializationHelper.cs
- XpsImageSerializationService.cs
- OracleTimeSpan.cs
- DiagnosticsConfigurationHandler.cs
- FloatUtil.cs
- TypeDescriptor.cs
- ApplicationSecurityManager.cs
- Baml2006KnownTypes.cs
- SqlDataSourceAdvancedOptionsForm.cs
- DecoderReplacementFallback.cs
- TextBoxAutomationPeer.cs
- SessionStateItemCollection.cs
- SecondaryIndex.cs
- ExpressionEditorAttribute.cs
- ResXBuildProvider.cs
- RadioButton.cs
- FrameworkTemplate.cs
- MultilineStringEditor.cs
- HtmlEncodedRawTextWriter.cs
- DesignerLinkAdapter.cs
- VisualTreeHelper.cs
- ToolStripPanel.cs
- DBDataPermissionAttribute.cs
- InheritanceAttribute.cs
- OleDbFactory.cs
- CatalogPartDesigner.cs
- EmptyWorkItem.cs
- DataGridHeaderBorder.cs
- SqlCommand.cs
- UrlUtility.cs
- WindowsListViewItemCheckBox.cs
- ExpressionPrefixAttribute.cs
- EntityViewContainer.cs
- XmlWriter.cs
- StreamMarshaler.cs
- Content.cs
- CompilerParameters.cs
- Serializer.cs
- SoapInteropTypes.cs
- PtsContext.cs
- RoleManagerSection.cs
- PageContentCollection.cs
- TemplateBindingExpressionConverter.cs
- AlphabeticalEnumConverter.cs
- ResourceReader.cs
- DataPager.cs
- XsdDuration.cs
- BuiltInPermissionSets.cs
- SkewTransform.cs
- RectangleGeometry.cs
- MembershipSection.cs
- PrintingPermissionAttribute.cs
- DecimalAnimation.cs
- Queue.cs
- AuthStoreRoleProvider.cs
- VectorValueSerializer.cs