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
- FusionWrap.cs
- WindowsTitleBar.cs
- LessThan.cs
- WebContext.cs
- QueryGenerator.cs
- Predicate.cs
- ProviderConnectionPointCollection.cs
- DiscoveryMessageSequenceCD1.cs
- LayoutEditorPart.cs
- ContextMenuService.cs
- HttpCachePolicy.cs
- AssemblyFilter.cs
- SqlTransaction.cs
- DataKeyArray.cs
- EditingMode.cs
- ExpressionServices.cs
- DummyDataSource.cs
- WorkflowMarkupSerializerMapping.cs
- DictionaryGlobals.cs
- X509CertificateCollection.cs
- XmlIncludeAttribute.cs
- RbTree.cs
- SchemaNames.cs
- EventToken.cs
- MethodCallConverter.cs
- SystemIPInterfaceProperties.cs
- Annotation.cs
- TaiwanLunisolarCalendar.cs
- InstanceCollisionException.cs
- FactorySettingsElement.cs
- DynamicQueryableWrapper.cs
- ContainerParaClient.cs
- RoutedEventConverter.cs
- TabItemAutomationPeer.cs
- PropertyTabChangedEvent.cs
- PageEventArgs.cs
- TransactionState.cs
- PrimitiveSchema.cs
- BinHexEncoding.cs
- ActivityTypeResolver.xaml.cs
- GroupLabel.cs
- mactripleDES.cs
- Vector3D.cs
- ValidatedControlConverter.cs
- GroupQuery.cs
- WorkerRequest.cs
- DataBindEngine.cs
- IsolatedStorageException.cs
- FixedSOMLineCollection.cs
- SessionStateSection.cs
- ComplusTypeValidator.cs
- Int32AnimationBase.cs
- SoapSchemaMember.cs
- ActiveXContainer.cs
- TimeZone.cs
- ObjectDataSourceMethodEditor.cs
- DataTableMapping.cs
- WindowsTokenRoleProvider.cs
- SearchForVirtualItemEventArgs.cs
- SettingsPropertyValueCollection.cs
- ThreadAbortException.cs
- OperationCanceledException.cs
- GlyphRunDrawing.cs
- BitmapMetadata.cs
- ChooseAction.cs
- _AutoWebProxyScriptHelper.cs
- TrustLevel.cs
- TimeoutValidationAttribute.cs
- NotifyInputEventArgs.cs
- QuaternionAnimationUsingKeyFrames.cs
- OdbcConnectionFactory.cs
- ByteAnimationUsingKeyFrames.cs
- SignHashRequest.cs
- ListCardsInFileRequest.cs
- WindowsScrollBarBits.cs
- TextParentUndoUnit.cs
- MaskedTextBoxDesignerActionList.cs
- DetailsViewPageEventArgs.cs
- PropertyDescriptorCollection.cs
- SqlAliasesReferenced.cs
- WorkerRequest.cs
- CompiledQuery.cs
- DeliveryStrategy.cs
- MethodExecutor.cs
- Span.cs
- ProbeMatchesMessage11.cs
- OAVariantLib.cs
- XNodeValidator.cs
- PrivilegedConfigurationManager.cs
- PriorityRange.cs
- ControlValuePropertyAttribute.cs
- DataGridViewColumnCollection.cs
- ManagedFilter.cs
- DeviceFiltersSection.cs
- DetailsViewInsertEventArgs.cs
- SingleAnimationUsingKeyFrames.cs
- GenericIdentity.cs
- PersistChildrenAttribute.cs
- DrawingDrawingContext.cs
- AnimationClock.cs