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
- WindowPattern.cs
- xamlnodes.cs
- StringStorage.cs
- TogglePatternIdentifiers.cs
- ContentDesigner.cs
- CheckBoxRenderer.cs
- WebPart.cs
- DesignerActionVerbList.cs
- ToolCreatedEventArgs.cs
- ImageAnimator.cs
- TreeNodeBindingDepthConverter.cs
- Comparer.cs
- ToolStripItemImageRenderEventArgs.cs
- IsolatedStorageFile.cs
- RequestTimeoutManager.cs
- ActivityValidator.cs
- ApplicationCommands.cs
- DataGridTablesFactory.cs
- WindowsFormsLinkLabel.cs
- SecondaryViewProvider.cs
- TextMarkerSource.cs
- ProcessModule.cs
- ClientSettingsStore.cs
- ClientViaElement.cs
- EditCommandColumn.cs
- Emitter.cs
- ISAPIWorkerRequest.cs
- WebPartDescriptionCollection.cs
- ViewStateException.cs
- RuleProcessor.cs
- IgnoreFlushAndCloseStream.cs
- PartialTrustValidationBehavior.cs
- SmtpException.cs
- HMACSHA384.cs
- FunctionCommandText.cs
- SignalGate.cs
- InputEventArgs.cs
- SchemaAttDef.cs
- BinaryFormatter.cs
- XmlSchemaObjectTable.cs
- DataGridViewToolTip.cs
- ResourcePool.cs
- RemoteWebConfigurationHostStream.cs
- DatePickerDateValidationErrorEventArgs.cs
- Ref.cs
- GetPageNumberCompletedEventArgs.cs
- DataRow.cs
- ExtensionQuery.cs
- IntegerFacetDescriptionElement.cs
- FamilyMap.cs
- FrameworkElementFactory.cs
- OperationContractGenerationContext.cs
- HeaderCollection.cs
- LogRestartAreaEnumerator.cs
- DataGridViewTopLeftHeaderCell.cs
- ListControlActionList.cs
- EntityDesignerUtils.cs
- TaiwanCalendar.cs
- DynamicRendererThreadManager.cs
- tibetanshape.cs
- StorageFunctionMapping.cs
- ForeignKeyConstraint.cs
- FontCollection.cs
- Context.cs
- TransactionOptions.cs
- RegistrySecurity.cs
- Win32.cs
- BooleanStorage.cs
- AppModelKnownContentFactory.cs
- ApplicationSecurityInfo.cs
- MemberCollection.cs
- indexingfiltermarshaler.cs
- ManagedFilter.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- EntityReference.cs
- CultureInfoConverter.cs
- SqlDuplicator.cs
- XslTransform.cs
- BufferedReceiveManager.cs
- SpeakProgressEventArgs.cs
- EdmType.cs
- LinqTreeNodeEvaluator.cs
- TableLayoutColumnStyleCollection.cs
- DefaultParameterValueAttribute.cs
- DataGrid.cs
- WebPartPersonalization.cs
- XmlSchemaObjectCollection.cs
- SystemFonts.cs
- OpacityConverter.cs
- FixedSOMGroup.cs
- Listbox.cs
- ConnectionManagementSection.cs
- CompiledELinqQueryState.cs
- TraceHandlerErrorFormatter.cs
- LogLogRecordEnumerator.cs
- MsmqInputChannelBase.cs
- EventProviderBase.cs
- SelectionWordBreaker.cs
- AddInServer.cs
- DataSourceXmlSubItemAttribute.cs