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
- ImageClickEventArgs.cs
- SpotLight.cs
- BasePropertyDescriptor.cs
- PersonalizableAttribute.cs
- DesignerGenericWebPart.cs
- EntityDataSourceChangedEventArgs.cs
- BackgroundFormatInfo.cs
- FactoryGenerator.cs
- TreeView.cs
- Point.cs
- ButtonChrome.cs
- DiscoveryClientProtocol.cs
- DocumentPageViewAutomationPeer.cs
- ChangeToolStripParentVerb.cs
- RowUpdatedEventArgs.cs
- EdgeProfileValidation.cs
- EditorPart.cs
- Crypto.cs
- SmiTypedGetterSetter.cs
- DocumentViewerBaseAutomationPeer.cs
- ManipulationInertiaStartingEventArgs.cs
- RichListBox.cs
- SecurityDocument.cs
- TableItemStyle.cs
- DecimalConverter.cs
- CryptoConfig.cs
- ServiceModelConfigurationElementCollection.cs
- TextEditorParagraphs.cs
- CapabilitiesUse.cs
- Calendar.cs
- ContractBase.cs
- Rule.cs
- ExpressionCopier.cs
- CustomCategoryAttribute.cs
- __ComObject.cs
- EasingKeyFrames.cs
- RichTextBox.cs
- BaseCAMarshaler.cs
- WebContext.cs
- EditorBrowsableAttribute.cs
- ContextMenuStripGroupCollection.cs
- AssemblyFilter.cs
- InputLanguageCollection.cs
- CustomErrorsSection.cs
- DependencyPropertyKey.cs
- ExtensionQuery.cs
- PermissionSetEnumerator.cs
- TokenBasedSetEnumerator.cs
- SqlDataSourceFilteringEventArgs.cs
- ObjectHelper.cs
- XmlNotation.cs
- AssociationSetMetadata.cs
- Cursor.cs
- XmlWriter.cs
- HTMLTextWriter.cs
- RenderTargetBitmap.cs
- WebConfigurationManager.cs
- Point4D.cs
- XmlRawWriter.cs
- LocalBuilder.cs
- RootBuilder.cs
- SystemIPGlobalStatistics.cs
- PageEventArgs.cs
- DataSourceView.cs
- DataGridItem.cs
- HandlerWithFactory.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- ToolStripPanelRenderEventArgs.cs
- AutomationProperties.cs
- StorageModelBuildProvider.cs
- ImageList.cs
- XmlSchemaAnnotation.cs
- securitycriticaldata.cs
- CardSpacePolicyElement.cs
- Image.cs
- ExpressionPrinter.cs
- MetricEntry.cs
- EventToken.cs
- TextEncodedRawTextWriter.cs
- ConfigXmlDocument.cs
- ProjectionQueryOptionExpression.cs
- TimeSpanValidator.cs
- BaseTemplateParser.cs
- SocketPermission.cs
- HtmlEmptyTagControlBuilder.cs
- PageHandlerFactory.cs
- DataGridViewRowHeaderCell.cs
- SourceFileInfo.cs
- AffineTransform3D.cs
- TypeSystemProvider.cs
- PDBReader.cs
- SqlDataSource.cs
- ObjectKeyFrameCollection.cs
- TemplateKeyConverter.cs
- OleDbException.cs
- IconHelper.cs
- MessageDirection.cs
- ForwardPositionQuery.cs
- UsernameTokenFactoryCredential.cs
- RandomNumberGenerator.cs