Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Util / Tuple.cs / 1 / 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; // This is the algorithm used in Whidbey to combine hashcodes. // It adheres better than a simple XOR to the randomness requirement for hashcodes. int hash = _items[0].GetHashCode(); for (int i = 1; i < _items.Length; i++) { hash = HashCodeCombiner.CombineHashCodes(hash, _items[i].GetHashCode()); } return hash; } 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CheckBoxAutomationPeer.cs
- JoinElimination.cs
- SmiRequestExecutor.cs
- MatrixStack.cs
- CommandDevice.cs
- TriggerCollection.cs
- TextEditorMouse.cs
- RealProxy.cs
- QilXmlReader.cs
- SHA1.cs
- UrlMappingsModule.cs
- TableLayoutPanelDesigner.cs
- CompatibleComparer.cs
- NonParentingControl.cs
- ScheduleChanges.cs
- CollectionDataContractAttribute.cs
- LeaseManager.cs
- XmlReflectionImporter.cs
- ParameterToken.cs
- SimpleExpression.cs
- TableRowCollection.cs
- TemplateControlCodeDomTreeGenerator.cs
- ResourceAssociationSet.cs
- AutoGeneratedFieldProperties.cs
- NetworkInformationException.cs
- TaskFormBase.cs
- ScrollPatternIdentifiers.cs
- StrokeRenderer.cs
- XmlSchemaImporter.cs
- ListenUriMode.cs
- xml.cs
- GroupAggregateExpr.cs
- ProfileParameter.cs
- TypedElement.cs
- DataControlCommands.cs
- Int32Storage.cs
- ViewPort3D.cs
- TextParentUndoUnit.cs
- SelectionChangedEventArgs.cs
- StrokeNode.cs
- ObjectCloneHelper.cs
- ObjectTag.cs
- UncommonField.cs
- ExpressionBuilderCollection.cs
- WebPartCloseVerb.cs
- Misc.cs
- UiaCoreProviderApi.cs
- StandardToolWindows.cs
- WeakReference.cs
- InternalDispatchObject.cs
- OleDbTransaction.cs
- HttpPostedFile.cs
- UrlMappingCollection.cs
- _ConnectionGroup.cs
- DrawingBrush.cs
- HandleRef.cs
- SafeLocalAllocation.cs
- ScriptResourceInfo.cs
- UnmanagedMemoryAccessor.cs
- CDSsyncETWBCLProvider.cs
- DecoderFallback.cs
- OperationContractAttribute.cs
- CreateUserWizardStep.cs
- RequestCachePolicy.cs
- ToolTipService.cs
- SafeReversePInvokeHandle.cs
- X509IssuerSerialKeyIdentifierClause.cs
- BindingUtils.cs
- AVElementHelper.cs
- AssemblyResourceLoader.cs
- TabItemWrapperAutomationPeer.cs
- ComContractElement.cs
- Tracking.cs
- DecimalConverter.cs
- ListViewHitTestInfo.cs
- CodePrimitiveExpression.cs
- SqlConnectionPoolGroupProviderInfo.cs
- IntranetCredentialPolicy.cs
- MobileTemplatedControlDesigner.cs
- DataSet.cs
- IsolationInterop.cs
- QilLiteral.cs
- ChameleonKey.cs
- PropertyChangingEventArgs.cs
- BufferBuilder.cs
- _TransmitFileOverlappedAsyncResult.cs
- ClientSponsor.cs
- EmbeddedMailObjectCollectionEditor.cs
- SqlDataSourceView.cs
- PrePrepareMethodAttribute.cs
- XmlNamespaceDeclarationsAttribute.cs
- GridViewRow.cs
- XmlRawWriterWrapper.cs
- ItemChangedEventArgs.cs
- TextServicesCompartment.cs
- DocumentScope.cs
- FileDialog.cs
- UnmanagedMemoryStreamWrapper.cs
- SimpleLine.cs
- Image.cs