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
- ExpanderAutomationPeer.cs
- SudsWriter.cs
- SqlFacetAttribute.cs
- MessageBox.cs
- ImmComposition.cs
- PairComparer.cs
- CompressionTransform.cs
- InvalidOleVariantTypeException.cs
- Suspend.cs
- GeneratedView.cs
- PageAsyncTaskManager.cs
- WebConfigurationManager.cs
- HtmlTableRow.cs
- GenericsInstances.cs
- BindingValueChangedEventArgs.cs
- BackgroundWorker.cs
- EntityCommand.cs
- XmlAttributes.cs
- NameTable.cs
- MemberPath.cs
- Zone.cs
- PropertyEntry.cs
- EntityCommandCompilationException.cs
- UnicodeEncoding.cs
- SettingsProviderCollection.cs
- CodeComment.cs
- ColorPalette.cs
- OptimizedTemplateContentHelper.cs
- XPathScanner.cs
- ModelItemExtensions.cs
- EntityDataSourceColumn.cs
- Image.cs
- FrugalMap.cs
- ProvidersHelper.cs
- WindowInteractionStateTracker.cs
- AnnotationService.cs
- XmlNodeList.cs
- TraceContext.cs
- NamedPipeHostedTransportConfiguration.cs
- Span.cs
- ConfigurationValidatorAttribute.cs
- ListViewItem.cs
- CodeArrayIndexerExpression.cs
- Maps.cs
- sqlpipe.cs
- BrushMappingModeValidation.cs
- AccessorTable.cs
- TraceContextRecord.cs
- IImplicitResourceProvider.cs
- HybridDictionary.cs
- ChtmlPageAdapter.cs
- LogicalChannelCollection.cs
- PointValueSerializer.cs
- ExceptionUtil.cs
- XmlComplianceUtil.cs
- EventItfInfo.cs
- SqlDataSourceCommandEventArgs.cs
- OraclePermission.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- SHA256.cs
- XmlDownloadManager.cs
- ICollection.cs
- SqlUserDefinedAggregateAttribute.cs
- NavigationFailedEventArgs.cs
- ValidationErrorCollection.cs
- OperationAbortedException.cs
- WindowsToolbarItemAsMenuItem.cs
- LinkedList.cs
- ImplicitInputBrush.cs
- TemplatedMailWebEventProvider.cs
- TextFormatterImp.cs
- BridgeDataRecord.cs
- DataGridViewBand.cs
- AstTree.cs
- DecoderReplacementFallback.cs
- ForeignConstraint.cs
- CngUIPolicy.cs
- RegexGroup.cs
- httpstaticobjectscollection.cs
- serverconfig.cs
- WebPartCatalogCloseVerb.cs
- XmlSchemas.cs
- RSACryptoServiceProvider.cs
- XmlWhitespace.cs
- RepeaterCommandEventArgs.cs
- ToolStripContentPanelRenderEventArgs.cs
- UniqueID.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- PagerStyle.cs
- DetectRunnableInstancesTask.cs
- WCFModelStrings.Designer.cs
- ClientTargetCollection.cs
- PropertyChangeTracker.cs
- XmlIlTypeHelper.cs
- SafeRightsManagementQueryHandle.cs
- Random.cs
- WebPartRestoreVerb.cs
- XPathAxisIterator.cs
- FontInfo.cs