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
- XPathException.cs
- ErrorWebPart.cs
- IPAddress.cs
- ApplicationFileCodeDomTreeGenerator.cs
- QuadraticBezierSegment.cs
- PropertyChangedEventManager.cs
- CaseInsensitiveComparer.cs
- Preprocessor.cs
- SeparatorAutomationPeer.cs
- BindingBase.cs
- DataList.cs
- PartDesigner.cs
- HttpListenerException.cs
- NativeMethods.cs
- ContractCodeDomInfo.cs
- FieldBuilder.cs
- SqlTypeConverter.cs
- Command.cs
- LicenseContext.cs
- DataColumn.cs
- TextRunCacheImp.cs
- AffineTransform3D.cs
- ColumnMapCopier.cs
- MethodRental.cs
- AudienceUriMode.cs
- ListChangedEventArgs.cs
- Cell.cs
- CmsInterop.cs
- AuthStoreRoleProvider.cs
- ThreadStaticAttribute.cs
- ProvidePropertyAttribute.cs
- MonitoringDescriptionAttribute.cs
- SingleTagSectionHandler.cs
- PageContent.cs
- TextEvent.cs
- Control.cs
- SuppressMessageAttribute.cs
- Helpers.cs
- QilInvoke.cs
- ControlIdConverter.cs
- HuffmanTree.cs
- CacheAxisQuery.cs
- DataGridBoolColumn.cs
- PermissionRequestEvidence.cs
- SqlDependencyListener.cs
- DbMetaDataColumnNames.cs
- GenericWebPart.cs
- PublishLicense.cs
- KeyInterop.cs
- StrokeCollection.cs
- XsltOutput.cs
- IMembershipProvider.cs
- InvalidAsynchronousStateException.cs
- AstTree.cs
- WindowAutomationPeer.cs
- GradientSpreadMethodValidation.cs
- StorageAssociationSetMapping.cs
- ColorMap.cs
- SmtpReplyReaderFactory.cs
- HandlerBase.cs
- SslStreamSecurityUpgradeProvider.cs
- SerialStream.cs
- EntityTransaction.cs
- TemplateInstanceAttribute.cs
- InkPresenter.cs
- BinaryCommonClasses.cs
- HttpGetProtocolImporter.cs
- PropertyNames.cs
- SpecialNameAttribute.cs
- DataViewManagerListItemTypeDescriptor.cs
- newinstructionaction.cs
- CatalogUtil.cs
- StatusBarItem.cs
- FormViewModeEventArgs.cs
- RegexGroupCollection.cs
- linebase.cs
- RangeValuePattern.cs
- TopClause.cs
- XamlSerializer.cs
- RuleProcessor.cs
- Encoder.cs
- InputReport.cs
- SortableBindingList.cs
- AssemblyResourceLoader.cs
- DataKeyArray.cs
- XmlHierarchicalEnumerable.cs
- SignatureDescription.cs
- SignerInfo.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- FixedPageAutomationPeer.cs
- Tokenizer.cs
- Size3DConverter.cs
- TextModifier.cs
- HtmlInputRadioButton.cs
- TrustManagerMoreInformation.cs
- HeaderCollection.cs
- SqlCommandBuilder.cs
- MetadataAssemblyHelper.cs
- BitmapImage.cs
- XmlQueryStaticData.cs