Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- SerializationEventsCache.cs
- LinkArea.cs
- ToolStripItemCollection.cs
- TabRenderer.cs
- Compiler.cs
- Literal.cs
- MarkerProperties.cs
- BlurBitmapEffect.cs
- SocketConnection.cs
- Number.cs
- TableLayoutPanelCellPosition.cs
- UIElementParaClient.cs
- DataPagerFieldCollection.cs
- ListMarkerLine.cs
- Annotation.cs
- IisTraceListener.cs
- UserControlBuildProvider.cs
- objectresult_tresulttype.cs
- isolationinterop.cs
- UrlPath.cs
- ButtonFieldBase.cs
- WebColorConverter.cs
- ExpanderAutomationPeer.cs
- FormsAuthenticationEventArgs.cs
- SID.cs
- TypeListConverter.cs
- DataGridCellsPanel.cs
- CorrelationTokenInvalidatedHandler.cs
- PostBackTrigger.cs
- ScriptReferenceEventArgs.cs
- HwndSourceParameters.cs
- CodeSnippetExpression.cs
- Wizard.cs
- TraceLevelHelper.cs
- MessageBuilder.cs
- CodeIndexerExpression.cs
- ImageProxy.cs
- ContextMenuService.cs
- ThreadPool.cs
- PerfCounters.cs
- WithParamAction.cs
- WebScriptMetadataInstanceContextProvider.cs
- DbConnectionClosed.cs
- DrawingAttributes.cs
- StandardBindingCollectionElement.cs
- GrammarBuilderBase.cs
- RequestQueue.cs
- ProtocolsConfigurationEntry.cs
- Win32NamedPipes.cs
- ConfigXmlWhitespace.cs
- LoginName.cs
- UpdateCompiler.cs
- ConfigXmlComment.cs
- DataServiceQueryOfT.cs
- TableLayoutStyle.cs
- Win32.cs
- SchemaNotation.cs
- NonBatchDirectoryCompiler.cs
- SiteMapSection.cs
- HostDesigntimeLicenseContext.cs
- DynamicRenderer.cs
- SortAction.cs
- KeyedCollection.cs
- WebPartPersonalization.cs
- DBSchemaRow.cs
- XmlSchemaGroupRef.cs
- DataGridColumnDropSeparator.cs
- FontDifferentiator.cs
- AutomationAttributeInfo.cs
- FormatControl.cs
- AutoGeneratedField.cs
- FixedTextView.cs
- SoapMessage.cs
- ObfuscationAttribute.cs
- DataGridViewCellValueEventArgs.cs
- PageParser.cs
- BindingCollection.cs
- SHA512CryptoServiceProvider.cs
- DataGridViewCheckBoxColumn.cs
- ReflectionTypeLoadException.cs
- DataKeyCollection.cs
- InfoCardAsymmetricCrypto.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- ExtensionWindow.cs
- ThreadSafeList.cs
- SimpleTextLine.cs
- HtmlHead.cs
- PixelFormatConverter.cs
- SchemaSetCompiler.cs
- PeerNameRecord.cs
- ContractMapping.cs
- SqlProviderManifest.cs
- FieldMetadata.cs
- CellParaClient.cs
- TreeViewAutomationPeer.cs
- DynamicMethod.cs
- UrlMappingCollection.cs
- SQLInt32Storage.cs
- BinaryFormatterSinks.cs
- Point.cs