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
- MergeFilterQuery.cs
- DrawingImage.cs
- WhitespaceSignificantCollectionAttribute.cs
- ExtendedPropertyCollection.cs
- ScaleTransform.cs
- TripleDESCryptoServiceProvider.cs
- MailDefinition.cs
- KeyPressEvent.cs
- TypefaceMetricsCache.cs
- CodeTypeConstructor.cs
- Base64Encoder.cs
- SqlStream.cs
- PageParserFilter.cs
- WebPartZoneAutoFormat.cs
- FlowLayoutPanel.cs
- StateManagedCollection.cs
- WebPartAuthorizationEventArgs.cs
- SqlBooleanMismatchVisitor.cs
- HScrollProperties.cs
- WebPartManagerInternals.cs
- ConfigurationManagerInternalFactory.cs
- BrowserCapabilitiesCodeGenerator.cs
- SizeKeyFrameCollection.cs
- FacetChecker.cs
- XPathNodeHelper.cs
- ControlPaint.cs
- ScaleTransform3D.cs
- AddInStore.cs
- SharedStream.cs
- ApplicationProxyInternal.cs
- EntityDataSourceContextCreatingEventArgs.cs
- WebPartConnectionCollection.cs
- UnsafeNativeMethodsPenimc.cs
- ResourceExpressionBuilder.cs
- TextViewElement.cs
- Clipboard.cs
- Journaling.cs
- UnsafeNativeMethods.cs
- XmlQualifiedName.cs
- ToolStripGripRenderEventArgs.cs
- TypeNameConverter.cs
- AutomationPattern.cs
- ZipIOExtraFieldElement.cs
- BindingExpression.cs
- XsltCompileContext.cs
- SqlBuilder.cs
- WmlObjectListAdapter.cs
- VisualProxy.cs
- RegexCompilationInfo.cs
- Timer.cs
- ReflectionHelper.cs
- UnmanagedMarshal.cs
- MemberDomainMap.cs
- SqlHelper.cs
- DesignerActionService.cs
- SupportsPreviewControlAttribute.cs
- CreatingCookieEventArgs.cs
- QilDataSource.cs
- DocumentGrid.cs
- PublisherIdentityPermission.cs
- SafeHandle.cs
- SQLResource.cs
- IntPtr.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- DriveInfo.cs
- XmlSchemaDocumentation.cs
- PageBuildProvider.cs
- WorkflowInstance.cs
- StreamResourceInfo.cs
- ImageMap.cs
- StatusBarItemAutomationPeer.cs
- JavaScriptObjectDeserializer.cs
- IisTraceListener.cs
- EditorBrowsableAttribute.cs
- HostedHttpContext.cs
- XmlSerializationGeneratedCode.cs
- EpmSyndicationContentSerializer.cs
- CollectionDataContract.cs
- ButtonFieldBase.cs
- Socket.cs
- PrintControllerWithStatusDialog.cs
- OutgoingWebResponseContext.cs
- DecimalAnimationUsingKeyFrames.cs
- SafeViewOfFileHandle.cs
- WebMessageEncodingBindingElement.cs
- PointLight.cs
- DetailsViewDeletedEventArgs.cs
- TransformProviderWrapper.cs
- FormsAuthenticationEventArgs.cs
- EntityParameterCollection.cs
- DeclarationUpdate.cs
- HyperLink.cs
- ContainerControlDesigner.cs
- RegistryDataKey.cs
- StringArrayEditor.cs
- PageThemeParser.cs
- SerializationStore.cs
- MarginCollapsingState.cs
- DataPager.cs
- ToolStripOverflow.cs