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
- TraceXPathNavigator.cs
- Axis.cs
- SiteMapDataSourceView.cs
- SectionXmlInfo.cs
- PointAnimationUsingPath.cs
- InstanceCreationEditor.cs
- TemplateControlParser.cs
- TextBoxBase.cs
- ListViewDeletedEventArgs.cs
- ProfilePropertyMetadata.cs
- MatrixStack.cs
- CellRelation.cs
- PropertyChangeTracker.cs
- ImageCodecInfo.cs
- ManualWorkflowSchedulerService.cs
- IISMapPath.cs
- MatrixAnimationUsingKeyFrames.cs
- WorkflowItemPresenter.cs
- IssuanceTokenProviderState.cs
- BindingValueChangedEventArgs.cs
- ControlOperationBehavior.cs
- Run.cs
- DataGridItemEventArgs.cs
- IPAddress.cs
- MouseGestureValueSerializer.cs
- FocusWithinProperty.cs
- CodeRemoveEventStatement.cs
- EntityClientCacheEntry.cs
- PeerCollaboration.cs
- Comparer.cs
- RelationshipType.cs
- XmlDataSource.cs
- HttpResponseHeader.cs
- EmptyImpersonationContext.cs
- XmlSchemaGroupRef.cs
- CodeLinePragma.cs
- NonVisualControlAttribute.cs
- ProfileModule.cs
- LinkedResource.cs
- CatalogZone.cs
- DtdParser.cs
- TaiwanCalendar.cs
- PageAdapter.cs
- ToolStripInSituService.cs
- Set.cs
- DataListCommandEventArgs.cs
- DataGridHelper.cs
- SqlGenericUtil.cs
- CircleHotSpot.cs
- ObjectItemCollection.cs
- ConfigurationManagerInternalFactory.cs
- ContentType.cs
- ProvidePropertyAttribute.cs
- ItemChangedEventArgs.cs
- DesignerSerializerAttribute.cs
- QueryStringParameter.cs
- PropertyValueChangedEvent.cs
- TypedTableBaseExtensions.cs
- EventMemberCodeDomSerializer.cs
- ThrowOnMultipleAssignment.cs
- ItemList.cs
- IdleTimeoutMonitor.cs
- MediaElementAutomationPeer.cs
- GridViewRowEventArgs.cs
- ListMarkerSourceInfo.cs
- XmlWellformedWriter.cs
- TransformedBitmap.cs
- DataColumnPropertyDescriptor.cs
- __ConsoleStream.cs
- UncommonField.cs
- RC2CryptoServiceProvider.cs
- EventListener.cs
- DecoderReplacementFallback.cs
- ColorMap.cs
- SuppressMergeCheckAttribute.cs
- TextDpi.cs
- TablePattern.cs
- TextControlDesigner.cs
- ListenerAdaptersInstallComponent.cs
- PeerOutputChannel.cs
- NativeMethodsOther.cs
- ChtmlTextWriter.cs
- SerializationFieldInfo.cs
- StylusEditingBehavior.cs
- XPathConvert.cs
- MessageQueueEnumerator.cs
- OrderedDictionary.cs
- TextElementEnumerator.cs
- NavigateEvent.cs
- BitmapMetadata.cs
- InstanceData.cs
- BooleanFunctions.cs
- BuildProviderCollection.cs
- ColumnHeaderCollectionEditor.cs
- DataExpression.cs
- HttpCacheParams.cs
- FormatConvertedBitmap.cs
- ProjectionCamera.cs
- DuplicateWaitObjectException.cs
- xmlformatgeneratorstatics.cs