Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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; 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
- MulticastNotSupportedException.cs
- DriveNotFoundException.cs
- FontUnitConverter.cs
- _OSSOCK.cs
- WebPartEditVerb.cs
- MemberRelationshipService.cs
- remotingproxy.cs
- DataGridViewButtonCell.cs
- IndentTextWriter.cs
- TextContainerHelper.cs
- SystemIPAddressInformation.cs
- FastEncoderWindow.cs
- FigureHelper.cs
- XmlDocumentViewSchema.cs
- LingerOption.cs
- PartitionerQueryOperator.cs
- View.cs
- IISMapPath.cs
- FixedHyperLink.cs
- WindowsPrincipal.cs
- GridViewRow.cs
- ConfigurationStrings.cs
- LinqDataSourceDisposeEventArgs.cs
- _NetworkingPerfCounters.cs
- HitTestDrawingContextWalker.cs
- PostBackOptions.cs
- XNodeSchemaApplier.cs
- DriveNotFoundException.cs
- ValidatorCompatibilityHelper.cs
- BackStopAuthenticationModule.cs
- DataRowExtensions.cs
- Guid.cs
- ColumnMap.cs
- COM2ExtendedBrowsingHandler.cs
- MsmqTransportSecurityElement.cs
- ItemCollection.cs
- ApplicationTrust.cs
- XmlBinaryWriter.cs
- Evidence.cs
- RtfToXamlReader.cs
- ConnectionPoint.cs
- _TimerThread.cs
- CompilerWrapper.cs
- codemethodreferenceexpression.cs
- URI.cs
- SqlDataSourceCustomCommandPanel.cs
- PropertyDescriptorGridEntry.cs
- ViewGenResults.cs
- PersistenceTypeAttribute.cs
- ConfigXmlComment.cs
- SqlDeflator.cs
- Message.cs
- UriExt.cs
- WebPartManager.cs
- EventHandlers.cs
- DoubleAnimationClockResource.cs
- MetadataPropertyCollection.cs
- ArrayTypeMismatchException.cs
- DecimalFormatter.cs
- AsynchronousChannel.cs
- Util.cs
- KeyProperty.cs
- FrameworkRichTextComposition.cs
- SecurityPolicyVersion.cs
- TimeEnumHelper.cs
- CustomValidator.cs
- ContextMenuStripGroupCollection.cs
- _RequestLifetimeSetter.cs
- PreviewPageInfo.cs
- AesManaged.cs
- ArgumentNullException.cs
- InternalBufferOverflowException.cs
- Substitution.cs
- EllipseGeometry.cs
- BufferedGraphics.cs
- AsmxEndpointPickerExtension.cs
- QilLoop.cs
- BaseResourcesBuildProvider.cs
- UnsignedPublishLicense.cs
- SuppressMergeCheckAttribute.cs
- URLString.cs
- CardSpaceSelector.cs
- TreeViewCancelEvent.cs
- ButtonStandardAdapter.cs
- TypeGeneratedEventArgs.cs
- StateMachineSubscription.cs
- ToolboxBitmapAttribute.cs
- ParamArrayAttribute.cs
- QueueProcessor.cs
- UnsafeNativeMethods.cs
- TableAdapterManagerMethodGenerator.cs
- BinaryObjectWriter.cs
- ScrollableControl.cs
- ISAPIRuntime.cs
- X509CertificateStore.cs
- TextLineResult.cs
- DefaultWorkflowTransactionService.cs
- DummyDataSource.cs
- ProcessStartInfo.cs
- XmlAttributeCollection.cs