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
- DataGridViewCellStyleConverter.cs
- PresentationTraceSources.cs
- RuleSettings.cs
- httpapplicationstate.cs
- EventLogReader.cs
- LocalizationComments.cs
- ResourceExpressionBuilder.cs
- HttpRuntimeSection.cs
- DocumentPageHost.cs
- QuaternionAnimation.cs
- PriorityBinding.cs
- SimpleWebHandlerParser.cs
- EventLogTraceListener.cs
- FileStream.cs
- FormViewDeletedEventArgs.cs
- ZipFileInfoCollection.cs
- BitmapEffectInputData.cs
- AutomationPeer.cs
- HttpModuleAction.cs
- FormsAuthenticationTicket.cs
- AmbientLight.cs
- Pts.cs
- TextDecoration.cs
- LinearGradientBrush.cs
- StreamUpdate.cs
- CompiledRegexRunner.cs
- EndPoint.cs
- IISUnsafeMethods.cs
- MimePart.cs
- TransformerConfigurationWizardBase.cs
- ScrollPatternIdentifiers.cs
- WsatTransactionHeader.cs
- EventProviderWriter.cs
- HtmlHistory.cs
- SQLDateTime.cs
- _LoggingObject.cs
- DesignerCommandAdapter.cs
- ImageMapEventArgs.cs
- BufferedGraphicsManager.cs
- AxisAngleRotation3D.cs
- DrawingBrush.cs
- IndexObject.cs
- ResourcePart.cs
- SortedList.cs
- OleDbConnectionInternal.cs
- ImmutableCollection.cs
- OwnerDrawPropertyBag.cs
- CompModSwitches.cs
- MetaModel.cs
- GeometryDrawing.cs
- AnnotationService.cs
- DataControlFieldsEditor.cs
- BulletChrome.cs
- ObjectView.cs
- HostingEnvironmentException.cs
- TextModifier.cs
- EdmRelationshipRoleAttribute.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CodeDOMProvider.cs
- ListViewItem.cs
- UseLicense.cs
- GeometryModel3D.cs
- ColorConvertedBitmap.cs
- AnnotationComponentChooser.cs
- ModifierKeysConverter.cs
- RegisteredDisposeScript.cs
- WindowsFormsHost.cs
- AccessibleObject.cs
- StatusBarPanelClickEvent.cs
- TagPrefixAttribute.cs
- KeyedCollection.cs
- LoginUtil.cs
- ConstrainedDataObject.cs
- MobileListItemCollection.cs
- DebugInfo.cs
- Subtree.cs
- MenuItem.cs
- NestedContainer.cs
- securitycriticaldataClass.cs
- XamlBuildTaskServices.cs
- PageAsyncTaskManager.cs
- ImageAutomationPeer.cs
- CommonGetThemePartSize.cs
- ScriptComponentDescriptor.cs
- HtmlAnchor.cs
- XmlObjectSerializerContext.cs
- ValueSerializerAttribute.cs
- iisPickupDirectory.cs
- XmlQuerySequence.cs
- TextEditorSpelling.cs
- OdbcConnectionFactory.cs
- CodePrimitiveExpression.cs
- DbConnectionClosed.cs
- SerializationUtilities.cs
- RestHandlerFactory.cs
- SettingsPropertyIsReadOnlyException.cs
- StylusEventArgs.cs
- TraceHandler.cs
- FormsAuthenticationCredentials.cs
- ReferencedType.cs