Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / xsp / System / Web / Extensions / Util / Tuple.cs / 2 / 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
- ECDiffieHellmanCngPublicKey.cs
- PowerStatus.cs
- Assembly.cs
- WriteFileContext.cs
- PlatformCulture.cs
- XmlElementAttributes.cs
- ConstructorNeedsTagAttribute.cs
- FileIOPermission.cs
- ProjectionNode.cs
- RequestCache.cs
- SQLChars.cs
- MembershipSection.cs
- XmlNamespaceDeclarationsAttribute.cs
- UDPClient.cs
- PropertyInformationCollection.cs
- _DigestClient.cs
- BinaryMethodMessage.cs
- UriTemplateLiteralPathSegment.cs
- Timer.cs
- AuthenticatedStream.cs
- DataGridViewCellValueEventArgs.cs
- FormsAuthenticationConfiguration.cs
- RtType.cs
- WebBrowserNavigatingEventHandler.cs
- ExceptionHandlers.cs
- RoleGroup.cs
- ClickablePoint.cs
- StringSource.cs
- ConfigurationSettings.cs
- ValidationSummary.cs
- IgnoreDeviceFilterElementCollection.cs
- CatalogPartChrome.cs
- XmlSchemaValidationException.cs
- ClosureBinding.cs
- TabControl.cs
- ServiceParser.cs
- ExpressionBindings.cs
- PolyBezierSegment.cs
- RuleSetDialog.Designer.cs
- VisualBasicImportReference.cs
- CollectionCodeDomSerializer.cs
- DictionaryBase.cs
- CollectionContainer.cs
- DATA_BLOB.cs
- SqlDependencyUtils.cs
- ManualWorkflowSchedulerService.cs
- XhtmlBasicControlAdapter.cs
- BuilderElements.cs
- CompoundFileIOPermission.cs
- NonParentingControl.cs
- StringConverter.cs
- StoryFragments.cs
- shaperfactoryquerycachekey.cs
- DynamicQueryableWrapper.cs
- ButtonBase.cs
- QueryAsyncResult.cs
- EntityDesignerDataSourceView.cs
- EventDescriptor.cs
- InputBindingCollection.cs
- XmlSchemaSimpleContentExtension.cs
- ImageConverter.cs
- _SslStream.cs
- IdentityManager.cs
- NativeMethods.cs
- ProcessHost.cs
- ObjectNavigationPropertyMapping.cs
- WebDisplayNameAttribute.cs
- GeometryValueSerializer.cs
- WebPartManager.cs
- StringExpressionSet.cs
- HttpRawResponse.cs
- ExpressionSelection.cs
- DateTimeStorage.cs
- DataSpaceManager.cs
- UnsafeNativeMethodsMilCoreApi.cs
- PageParserFilter.cs
- DbTransaction.cs
- VideoDrawing.cs
- LogManagementAsyncResult.cs
- RotateTransform.cs
- StrokeNodeOperations2.cs
- NativeMethods.cs
- ExpressionBinding.cs
- FreezableDefaultValueFactory.cs
- DecoderNLS.cs
- DbConnectionStringCommon.cs
- ConsoleTraceListener.cs
- TraceLevelStore.cs
- HasActivatableWorkflowEvent.cs
- ErrorItem.cs
- DataGridViewLinkColumn.cs
- BindingOperations.cs
- ImageListStreamer.cs
- TreeIterators.cs
- DecimalStorage.cs
- ProcessHostMapPath.cs
- ListView.cs
- WindowsSidIdentity.cs
- VerificationException.cs
- Ops.cs