Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XmlMemberMapping.cs
- IFormattable.cs
- DesignerActionList.cs
- dsa.cs
- SafeNativeMethods.cs
- DependencyObjectProvider.cs
- ManagementDateTime.cs
- PlatformCulture.cs
- SqlDuplicator.cs
- Duration.cs
- TextEditorLists.cs
- NameValueFileSectionHandler.cs
- WindowsImpersonationContext.cs
- SeekStoryboard.cs
- CopyAttributesAction.cs
- View.cs
- ModuleConfigurationInfo.cs
- SchemaImporter.cs
- WebResponse.cs
- NetPipeSection.cs
- CategoryNameCollection.cs
- CharacterMetrics.cs
- EntityViewGenerationAttribute.cs
- SqlServices.cs
- ShowExpandedMultiValueConverter.cs
- RayHitTestParameters.cs
- Int64Storage.cs
- PointAnimation.cs
- QueryCoreOp.cs
- PropertyGroupDescription.cs
- FileDetails.cs
- AsymmetricAlgorithm.cs
- FixedBufferAttribute.cs
- DataGridParentRows.cs
- TextBoxLine.cs
- GradientStop.cs
- IndexedString.cs
- TypeInfo.cs
- SchemaNames.cs
- CommonProperties.cs
- ShutDownListener.cs
- SecurityResources.cs
- UpdateExpressionVisitor.cs
- MembershipSection.cs
- UInt64Converter.cs
- DynamicRenderer.cs
- shaperfactory.cs
- CompiledQuery.cs
- StyleSelector.cs
- CacheManager.cs
- MenuItemBindingCollection.cs
- BaseResourcesBuildProvider.cs
- XmlDictionaryWriter.cs
- SourceFilter.cs
- SmiEventSink_Default.cs
- DesignerAutoFormatStyle.cs
- ImagingCache.cs
- ZipQueryOperator.cs
- SplitterPanel.cs
- GetPageNumberCompletedEventArgs.cs
- AttributeUsageAttribute.cs
- InputManager.cs
- DropShadowEffect.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DataTableMappingCollection.cs
- DateRangeEvent.cs
- PagedDataSource.cs
- XPathNodeHelper.cs
- BufferedOutputStream.cs
- ListViewUpdatedEventArgs.cs
- ActionItem.cs
- Util.cs
- CategoriesDocumentFormatter.cs
- Serializer.cs
- Timer.cs
- ReturnValue.cs
- EncryptedData.cs
- DBConcurrencyException.cs
- dataprotectionpermission.cs
- WindowsUpDown.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- DynamicEntity.cs
- ResponseStream.cs
- EntityUtil.cs
- HyperLinkStyle.cs
- UrlEncodedParameterWriter.cs
- RegexCaptureCollection.cs
- SqlConnectionPoolProviderInfo.cs
- CommandBinding.cs
- HandleExceptionArgs.cs
- HTMLTextWriter.cs
- GPRECTF.cs
- LoginAutoFormat.cs
- Point4D.cs
- WsatServiceAddress.cs
- ManifestResourceInfo.cs
- OleDbRowUpdatedEvent.cs
- NonClientArea.cs
- RawStylusActions.cs
- HttpModulesSection.cs