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
- CharConverter.cs
- CommandBinding.cs
- MimeTypeAttribute.cs
- RepeaterCommandEventArgs.cs
- ExpressionNode.cs
- UnsafeNativeMethods.cs
- SrgsItemList.cs
- DataGridViewMethods.cs
- TextElement.cs
- VarRefManager.cs
- WebPartTransformer.cs
- GuidelineCollection.cs
- PassportAuthenticationEventArgs.cs
- ClientEventManager.cs
- Int32CollectionConverter.cs
- UrlAuthorizationModule.cs
- Rect3D.cs
- HtmlInputRadioButton.cs
- FixUp.cs
- SymbolType.cs
- StructuredType.cs
- GridViewAutomationPeer.cs
- XslNumber.cs
- TextParaClient.cs
- FixedDocumentPaginator.cs
- XmlRawWriterWrapper.cs
- Page.cs
- Point3DKeyFrameCollection.cs
- DirectionalLight.cs
- MaskedTextBoxTextEditor.cs
- IteratorFilter.cs
- MenuBase.cs
- StrongNameUtility.cs
- TopClause.cs
- DynamicScriptObject.cs
- DbCommandDefinition.cs
- ControlDesigner.cs
- WorkflowOperationFault.cs
- TextPatternIdentifiers.cs
- ParameterCollection.cs
- GridViewCellAutomationPeer.cs
- Compiler.cs
- StaticTextPointer.cs
- MimeWriter.cs
- ToolStripSplitStackLayout.cs
- PinnedBufferMemoryStream.cs
- SrgsDocumentParser.cs
- SerializationObjectManager.cs
- RelationshipConstraintValidator.cs
- SecurityContextSecurityToken.cs
- WorkflowRuntimeService.cs
- LabelExpression.cs
- dataprotectionpermissionattribute.cs
- LicenseManager.cs
- DefaultTextStoreTextComposition.cs
- CryptoProvider.cs
- ValidationSettings.cs
- WebPageTraceListener.cs
- ObjectTag.cs
- AccessDataSource.cs
- FlowLayout.cs
- SQLDateTimeStorage.cs
- CodeCatchClauseCollection.cs
- ChannelSettingsElement.cs
- ContractReference.cs
- MemberInitExpression.cs
- HtmlTable.cs
- LostFocusEventManager.cs
- GridViewAutomationPeer.cs
- ConfigXmlText.cs
- TraceLog.cs
- WebBrowserDocumentCompletedEventHandler.cs
- NoneExcludedImageIndexConverter.cs
- WSSecurityXXX2005.cs
- NetTcpBindingElement.cs
- Camera.cs
- PinnedBufferMemoryStream.cs
- LessThan.cs
- GB18030Encoding.cs
- CuspData.cs
- Sql8ExpressionRewriter.cs
- SoapDocumentServiceAttribute.cs
- GlyphingCache.cs
- StringResourceManager.cs
- NavigationWindowAutomationPeer.cs
- COM2ComponentEditor.cs
- ServicePointManager.cs
- PackageRelationshipCollection.cs
- SafeNativeMethods.cs
- XmlSchemas.cs
- Rotation3D.cs
- UrlMapping.cs
- GroupBox.cs
- HttpHandlerAction.cs
- TextDecorationLocationValidation.cs
- XPathNodePointer.cs
- Material.cs
- DBSqlParserColumnCollection.cs
- HttpHandlerActionCollection.cs
- ContentWrapperAttribute.cs