Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Util / Tuple.cs / 1305376 / 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
- KeysConverter.cs
- Encoding.cs
- Internal.cs
- XmlSchemaObject.cs
- SessionEndingEventArgs.cs
- WhereQueryOperator.cs
- OnOperation.cs
- SQLRoleProvider.cs
- AutoResizedEvent.cs
- DataGridRowsPresenter.cs
- UIPropertyMetadata.cs
- FrameworkElement.cs
- prompt.cs
- ReadOnlyDictionary.cs
- XmlSignificantWhitespace.cs
- BehaviorEditorPart.cs
- WebPartManagerInternals.cs
- ArraySegment.cs
- ContractComponent.cs
- MemberDescriptor.cs
- ObjectDataSourceDisposingEventArgs.cs
- VirtualizedContainerService.cs
- PageCodeDomTreeGenerator.cs
- DispatcherOperation.cs
- ListViewItemSelectionChangedEvent.cs
- EntityDataSourceUtil.cs
- ReflectionTypeLoadException.cs
- OpenFileDialog.cs
- NotSupportedException.cs
- SecureUICommand.cs
- XmlHelper.cs
- WMICapabilities.cs
- RemoteWebConfigurationHostStream.cs
- BinaryMessageEncodingElement.cs
- TemplateBamlTreeBuilder.cs
- UndoEngine.cs
- PropertyInformationCollection.cs
- EnvironmentPermission.cs
- DnsCache.cs
- PointAnimation.cs
- SafeBitVector32.cs
- DesignerEventService.cs
- QuaternionConverter.cs
- PolicyUtility.cs
- GenericAuthenticationEventArgs.cs
- GridViewRowCollection.cs
- CodeGenerator.cs
- AdRotator.cs
- DocumentXPathNavigator.cs
- MetadataPropertyvalue.cs
- ModelItemCollection.cs
- DBDataPermission.cs
- ImageSourceValueSerializer.cs
- SelectionItemProviderWrapper.cs
- CaseExpr.cs
- DataRowCollection.cs
- HashSet.cs
- RSAPKCS1SignatureDeformatter.cs
- AppDomainGrammarProxy.cs
- MILUtilities.cs
- RequiredAttributeAttribute.cs
- XpsS0ValidatingLoader.cs
- Debug.cs
- SystemWebSectionGroup.cs
- SafeBitVector32.cs
- RuleConditionDialog.cs
- AssociationSet.cs
- CodeDOMUtility.cs
- BindingValueChangedEventArgs.cs
- OneToOneMappingSerializer.cs
- DataAdapter.cs
- DataGridViewImageCell.cs
- SpellerError.cs
- _WinHttpWebProxyDataBuilder.cs
- Context.cs
- BamlLocalizationDictionary.cs
- Fx.cs
- XmlSchemaSimpleContentExtension.cs
- BasicExpandProvider.cs
- FileDialog.cs
- FirewallWrapper.cs
- PointHitTestResult.cs
- _DisconnectOverlappedAsyncResult.cs
- DtdParser.cs
- Calendar.cs
- ScriptResourceHandler.cs
- HandledEventArgs.cs
- OdbcEnvironmentHandle.cs
- DetailsView.cs
- DataRecordObjectView.cs
- OleDbDataAdapter.cs
- ReliableChannelListener.cs
- BidPrivateBase.cs
- InputMethod.cs
- PageAction.cs
- InvocationExpression.cs
- PageAdapter.cs
- LineVisual.cs
- SpecularMaterial.cs
- XmlDocumentFragment.cs