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
- GenericAuthenticationEventArgs.cs
- RegexCode.cs
- FieldNameLookup.cs
- ToolStripRenderer.cs
- WindowsListViewScroll.cs
- InputReportEventArgs.cs
- ProtocolsConfigurationHandler.cs
- SpnegoTokenProvider.cs
- IconConverter.cs
- Propagator.Evaluator.cs
- BaseParaClient.cs
- InfocardChannelParameter.cs
- SevenBitStream.cs
- RMEnrollmentPage1.cs
- ObjectIDGenerator.cs
- SqlTypeSystemProvider.cs
- GrammarBuilderRuleRef.cs
- FontSourceCollection.cs
- AppSettingsExpressionEditor.cs
- TaskCanceledException.cs
- SQLString.cs
- StorageMappingItemLoader.cs
- AssociativeAggregationOperator.cs
- Point3DAnimationBase.cs
- WebPartDeleteVerb.cs
- PerfCounterSection.cs
- CellConstant.cs
- EastAsianLunisolarCalendar.cs
- EventlogProvider.cs
- DesignColumn.cs
- Application.cs
- PngBitmapDecoder.cs
- AccessibleObject.cs
- BamlLocalizer.cs
- ExeContext.cs
- XNodeValidator.cs
- ObjectNavigationPropertyMapping.cs
- CompositeDesignerAccessibleObject.cs
- BamlResourceDeserializer.cs
- LeafCellTreeNode.cs
- TextTrailingCharacterEllipsis.cs
- ISAPIWorkerRequest.cs
- PropertyManager.cs
- DataPager.cs
- CheckBoxRenderer.cs
- Tuple.cs
- NavigateEvent.cs
- ApplicationSettingsBase.cs
- String.cs
- HttpFileCollection.cs
- AsyncOperationManager.cs
- Item.cs
- SoapMessage.cs
- OleDbPermission.cs
- SqlCrossApplyToCrossJoin.cs
- IConvertible.cs
- ThreadInterruptedException.cs
- ListViewAutomationPeer.cs
- EventLogSession.cs
- Pens.cs
- ServiceModelPerformanceCounters.cs
- CommonRemoteMemoryBlock.cs
- EndpointDiscoveryElement.cs
- ComboBoxAutomationPeer.cs
- DrawTreeNodeEventArgs.cs
- DateTimeUtil.cs
- CompensateDesigner.cs
- MimeParameters.cs
- RubberbandSelector.cs
- TableLayoutStyle.cs
- BinaryNode.cs
- IItemProperties.cs
- ColumnWidthChangedEvent.cs
- ObjectMemberMapping.cs
- ExpressionNode.cs
- AuthenticatingEventArgs.cs
- SettingsPropertyNotFoundException.cs
- MetadataHelper.cs
- MultilineStringConverter.cs
- DetailsViewCommandEventArgs.cs
- JavaScriptSerializer.cs
- CompositionDesigner.cs
- DropShadowBitmapEffect.cs
- AutomationElementCollection.cs
- ExpressionNode.cs
- InputProcessorProfiles.cs
- RootBrowserWindowProxy.cs
- SchemaMapping.cs
- XmlReflectionMember.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ValidationService.cs
- AuthenticationModulesSection.cs
- DatagridviewDisplayedBandsData.cs
- WebFormDesignerActionService.cs
- linebase.cs
- XPathNodeHelper.cs
- QueueException.cs
- VariableModifiersHelper.cs
- TypeViewSchema.cs
- XsltLoader.cs