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
- PointConverter.cs
- DataPagerFieldCommandEventArgs.cs
- ManifestResourceInfo.cs
- TraceContextEventArgs.cs
- ObjectStateFormatter.cs
- ToolStripSplitButton.cs
- RegexWriter.cs
- ObjectAnimationBase.cs
- ThemeDictionaryExtension.cs
- linebase.cs
- OdbcFactory.cs
- CodeAttachEventStatement.cs
- ActivationServices.cs
- ThreadAttributes.cs
- TransportConfigurationTypeElement.cs
- RSAProtectedConfigurationProvider.cs
- DropShadowBitmapEffect.cs
- SchemaMapping.cs
- ListChunk.cs
- TreeNodeBinding.cs
- ProcessThread.cs
- QilList.cs
- GridViewSortEventArgs.cs
- BasicKeyConstraint.cs
- RemotingAttributes.cs
- Helper.cs
- XmlSchemaIdentityConstraint.cs
- TypeSystem.cs
- SemanticResultKey.cs
- SolidColorBrush.cs
- PrivateFontCollection.cs
- ContextInformation.cs
- DataGridView.cs
- AppModelKnownContentFactory.cs
- TextSelection.cs
- DocumentGridPage.cs
- Light.cs
- ICspAsymmetricAlgorithm.cs
- HScrollProperties.cs
- XmlUnspecifiedAttribute.cs
- StylusTip.cs
- ImageListStreamer.cs
- SchemaObjectWriter.cs
- SrgsElement.cs
- Command.cs
- XmlReflectionImporter.cs
- ISAPIRuntime.cs
- LabelExpression.cs
- FontStretch.cs
- ImportCatalogPart.cs
- InvalidCommandTreeException.cs
- Privilege.cs
- EndpointAddress10.cs
- ArrayElementGridEntry.cs
- DoneReceivingAsyncResult.cs
- AlternateView.cs
- ConsoleKeyInfo.cs
- _NetworkingPerfCounters.cs
- XmlText.cs
- ModuleElement.cs
- DataGridViewCellCancelEventArgs.cs
- GlyphsSerializer.cs
- WhereaboutsReader.cs
- DataPagerFieldCollection.cs
- ProcessInfo.cs
- SiteMapNodeCollection.cs
- TemplatePagerField.cs
- AnnotationObservableCollection.cs
- FindCriteriaApril2005.cs
- HwndKeyboardInputProvider.cs
- CodeDomComponentSerializationService.cs
- AnnouncementEndpoint.cs
- OutputCacheProfile.cs
- LicenseException.cs
- CriticalFinalizerObject.cs
- PropertyGridEditorPart.cs
- Util.cs
- DataListItemEventArgs.cs
- HostingEnvironmentSection.cs
- SQLBytes.cs
- NavigationFailedEventArgs.cs
- mongolianshape.cs
- QilSortKey.cs
- CqlErrorHelper.cs
- Hex.cs
- AutomationPropertyInfo.cs
- Utility.cs
- HttpClientCertificate.cs
- InputScopeNameConverter.cs
- IndexerNameAttribute.cs
- ToolStripItemClickedEventArgs.cs
- CodeMemberEvent.cs
- EntityDataSourceEntityTypeFilterItem.cs
- NavigationWindow.cs
- RangeBase.cs
- __Filters.cs
- HashMembershipCondition.cs
- TextCompositionManager.cs
- TextCompositionEventArgs.cs
- OdbcEnvironment.cs