Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Util / Tuple.cs / 1305376 / Tuple.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Util {
using System;
internal sealed class Tuple {
private object[] _items;
public Tuple(params object[] items) {
_items = items;
}
public object this[int index] {
get {
return _items[index];
}
}
public override int GetHashCode() {
if (_items.Length == 0) return 0;
HashCodeCombiner combiner = new HashCodeCombiner();
for (int i = 0; i < _items.Length; i++) {
combiner.AddObject(_items[i]);
}
return combiner.CombinedHash32;
}
public override bool Equals(object obj) {
if (obj == null) return false;
Tuple other = (Tuple)obj;
if (other == this) return true;
if ((other._items.Length != _items.Length)) return false;
for (int i = 0; i < _items.Length; i++) {
if (!other[i].Equals(this[i])) return false;
}
return true;
}
}
}
// 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
- Normalization.cs
- ChtmlTextBoxAdapter.cs
- _NegotiateClient.cs
- SelectionPattern.cs
- DocumentationServerProtocol.cs
- ParallelTimeline.cs
- StateMachine.cs
- DesignerAttributeInfo.cs
- PrintingPermissionAttribute.cs
- DllNotFoundException.cs
- XmlSchemaType.cs
- EntityDataSourceWizardForm.cs
- ImageMetadata.cs
- PlainXmlWriter.cs
- ProtectedProviderSettings.cs
- FileDataSourceCache.cs
- OutputCacheProfileCollection.cs
- PanelDesigner.cs
- PeerTransportListenAddressValidator.cs
- AxHostDesigner.cs
- BoolExpressionVisitors.cs
- ValidationErrorEventArgs.cs
- ScrollEventArgs.cs
- SharedUtils.cs
- OpenFileDialog.cs
- TableCellAutomationPeer.cs
- LazyLoadBehavior.cs
- PDBReader.cs
- FormatterServicesNoSerializableCheck.cs
- EditingContext.cs
- XComponentModel.cs
- metrodevice.cs
- ErrorFormatter.cs
- MutableAssemblyCacheEntry.cs
- SchemaAttDef.cs
- SettingsProperty.cs
- Focus.cs
- XsdSchemaFileEditor.cs
- UnsafeNativeMethods.cs
- ToolStripOverflowButton.cs
- WorkflowEnvironment.cs
- XhtmlBasicCalendarAdapter.cs
- BuildProvidersCompiler.cs
- UniqueEventHelper.cs
- MatrixCamera.cs
- ChtmlCalendarAdapter.cs
- UserMapPath.cs
- StreamReader.cs
- DropShadowBitmapEffect.cs
- StdValidatorsAndConverters.cs
- ValidationEventArgs.cs
- GorillaCodec.cs
- OutputCacheProfileCollection.cs
- TextEditorTables.cs
- TextRenderer.cs
- DataColumnPropertyDescriptor.cs
- LayoutSettings.cs
- WebPartVerbCollection.cs
- MulticastOption.cs
- HttpHandlerActionCollection.cs
- InheritablePropertyChangeInfo.cs
- DirectoryInfo.cs
- FormsAuthenticationUserCollection.cs
- TextParagraphView.cs
- WebFormsRootDesigner.cs
- PropertyPathWorker.cs
- SizeF.cs
- DecimalMinMaxAggregationOperator.cs
- X509Extension.cs
- _CacheStreams.cs
- MimeTypeMapper.cs
- GeneralTransform3DTo2D.cs
- WebPartHeaderCloseVerb.cs
- NameNode.cs
- ByteStream.cs
- GlobalizationSection.cs
- ToolStripSplitStackLayout.cs
- FrameworkTemplate.cs
- BindingFormattingDialog.cs
- Boolean.cs
- DataGridSortCommandEventArgs.cs
- BinaryKeyIdentifierClause.cs
- SqlGatherConsumedAliases.cs
- IdentityNotMappedException.cs
- MeshGeometry3D.cs
- AssociatedControlConverter.cs
- StrokeCollection.cs
- CodeTypeConstructor.cs
- ValidationResult.cs
- AxisAngleRotation3D.cs
- GradientStopCollection.cs
- HostProtectionException.cs
- ButtonField.cs
- XmlNodeList.cs
- IODescriptionAttribute.cs
- DiscoveryDocumentLinksPattern.cs
- UnsafeCollabNativeMethods.cs
- PerformanceCounterCategory.cs
- ResourceAttributes.cs
- EncryptedData.cs