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
- SqlExpander.cs
- _SslStream.cs
- CollectionsUtil.cs
- CustomWebEventKey.cs
- RotateTransform3D.cs
- ActivityBindForm.Designer.cs
- TabletDeviceInfo.cs
- CacheOutputQuery.cs
- CodeGenHelper.cs
- TextElementCollection.cs
- ConfigurationManagerInternal.cs
- Lasso.cs
- ExpandedWrapper.cs
- FloaterParagraph.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- XmlSchemaAnyAttribute.cs
- TraceSection.cs
- GcSettings.cs
- BinaryObjectWriter.cs
- Visual3D.cs
- SatelliteContractVersionAttribute.cs
- IndicShape.cs
- FlowchartStart.xaml.cs
- EntityDataSourceEntityTypeFilterItem.cs
- RequestQueue.cs
- DbConnectionPoolOptions.cs
- XsltArgumentList.cs
- Deflater.cs
- OnOperation.cs
- Compilation.cs
- SolidBrush.cs
- SessionState.cs
- WebRequestModulesSection.cs
- ExponentialEase.cs
- KerberosTokenFactoryCredential.cs
- TreeViewImageIndexConverter.cs
- XmlUTF8TextWriter.cs
- XmlParserContext.cs
- TableChangeProcessor.cs
- DescendentsWalker.cs
- ToolStripPanelRenderEventArgs.cs
- EllipseGeometry.cs
- SingleAnimationBase.cs
- RowCache.cs
- SafeCryptHandles.cs
- SystemMulticastIPAddressInformation.cs
- DataGridViewUtilities.cs
- PersianCalendar.cs
- TransformerInfo.cs
- NameTable.cs
- ZipIOLocalFileHeader.cs
- WebPartVerb.cs
- InternalPermissions.cs
- PropertyGridCommands.cs
- CodeGenerator.cs
- ThreadExceptionEvent.cs
- ReadOnlyDataSource.cs
- WebServicesSection.cs
- CurrentChangingEventManager.cs
- TypeDescriptionProvider.cs
- PersonalizationProviderHelper.cs
- HMACSHA1.cs
- _UncName.cs
- XmlSchemaSimpleContent.cs
- XPathSelfQuery.cs
- WebPartZone.cs
- ADRoleFactory.cs
- GridPatternIdentifiers.cs
- TextEndOfSegment.cs
- IntPtr.cs
- MissingFieldException.cs
- Base64Encoder.cs
- SafePointer.cs
- TextContainerChangedEventArgs.cs
- BaseDataListActionList.cs
- HtmlTableCellCollection.cs
- FormViewPageEventArgs.cs
- URLIdentityPermission.cs
- XMLSyntaxException.cs
- WorkflowItemPresenter.cs
- Part.cs
- SignatureDescription.cs
- HostingEnvironmentException.cs
- Popup.cs
- SiteOfOriginContainer.cs
- ProcessModelSection.cs
- LineVisual.cs
- URI.cs
- ProjectionRewriter.cs
- ClientSettingsSection.cs
- SafeNativeMethodsCLR.cs
- RightsManagementPermission.cs
- ValidatingPropertiesEventArgs.cs
- CodeExpressionRuleDeclaration.cs
- TableItemStyle.cs
- SignedXml.cs
- FlowDocumentReader.cs
- ResourceDictionary.cs
- Directory.cs
- TextHintingModeValidation.cs