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
- SpoolingTask.cs
- Message.cs
- CategoryGridEntry.cs
- TextAction.cs
- MethodBody.cs
- VariableAction.cs
- XamlPathDataSerializer.cs
- TypeReference.cs
- DesignOnlyAttribute.cs
- StringFormat.cs
- AsyncOperationManager.cs
- SqlDependencyUtils.cs
- Table.cs
- GridViewRow.cs
- PeerNameRegistration.cs
- FilteredReadOnlyMetadataCollection.cs
- RuntimeConfigurationRecord.cs
- ClientTargetSection.cs
- SoapEnumAttribute.cs
- Convert.cs
- ActivityExecutorDelegateInfo.cs
- PassportAuthentication.cs
- ColumnHeaderConverter.cs
- DurableInstancingOptions.cs
- BulletedList.cs
- RelationshipSet.cs
- PnrpPermission.cs
- WrappedKeySecurityToken.cs
- KeyValuePairs.cs
- LinqDataSourceContextEventArgs.cs
- BitmapEffect.cs
- ObjectStateEntryDbDataRecord.cs
- Helper.cs
- CrossAppDomainChannel.cs
- TrackingProfileSerializer.cs
- EmissiveMaterial.cs
- CodeTypeParameter.cs
- LinqDataSourceHelper.cs
- ReadOnlyHierarchicalDataSourceView.cs
- StreamGeometry.cs
- InvokeMemberBinder.cs
- DataSourceViewSchemaConverter.cs
- TileBrush.cs
- StreamWithDictionary.cs
- StrongNameUtility.cs
- SettingsPropertyValueCollection.cs
- WpfXamlType.cs
- ReflectPropertyDescriptor.cs
- NotImplementedException.cs
- TextTreeTextBlock.cs
- EntityDataSourceStatementEditor.cs
- DataViewManager.cs
- EdmToObjectNamespaceMap.cs
- RegexCode.cs
- Enumerable.cs
- MetadataCollection.cs
- SignedXml.cs
- InternalPolicyElement.cs
- BitmapEffectOutputConnector.cs
- PaperSize.cs
- FrameworkElementFactory.cs
- CheckedPointers.cs
- DefaultTraceListener.cs
- CodeNamespaceCollection.cs
- ConfigPathUtility.cs
- DescendentsWalkerBase.cs
- XmlValidatingReader.cs
- CommonRemoteMemoryBlock.cs
- ArgumentException.cs
- MouseGestureValueSerializer.cs
- Constants.cs
- IISMapPath.cs
- HashSetDebugView.cs
- SmiEventSink.cs
- InvokeGenerator.cs
- EdmValidator.cs
- DataSourceHelper.cs
- RbTree.cs
- DeclaredTypeElement.cs
- ListenerBinder.cs
- EmptyEnumerator.cs
- CountdownEvent.cs
- MetadataCacheItem.cs
- DataContractSerializer.cs
- WorkflowQueuingService.cs
- CollectionsUtil.cs
- InvokeWebServiceDesigner.cs
- DesignerAttribute.cs
- AssemblyInfo.cs
- RbTree.cs
- TextRunProperties.cs
- TextParagraphCache.cs
- ExpressionBuilderCollection.cs
- ReachPrintTicketSerializerAsync.cs
- XamlVector3DCollectionSerializer.cs
- processwaithandle.cs
- AttachedPropertyBrowsableAttribute.cs
- designeractionlistschangedeventargs.cs
- CqlLexer.cs
- ConfigurationManagerHelper.cs