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
- SharedUtils.cs
- ConnectionManagementElementCollection.cs
- SkipQueryOptionExpression.cs
- ReadWriteControlDesigner.cs
- EventHandlerList.cs
- NetTcpBinding.cs
- VisualTreeHelper.cs
- RectAnimationBase.cs
- DSASignatureDeformatter.cs
- BrowserCapabilitiesFactory.cs
- MethodBuilder.cs
- ModelFunction.cs
- BrowserTree.cs
- WebBrowserSiteBase.cs
- InputQueue.cs
- ContainerFilterService.cs
- ValidatorCompatibilityHelper.cs
- ZipIOCentralDirectoryBlock.cs
- BoundPropertyEntry.cs
- CollectionViewGroup.cs
- TCPListener.cs
- TypeForwardedToAttribute.cs
- IIS7UserPrincipal.cs
- DependencyPropertyValueSerializer.cs
- CharKeyFrameCollection.cs
- SQLInt64.cs
- SelectorItemAutomationPeer.cs
- Pointer.cs
- ByteFacetDescriptionElement.cs
- DataGridCellClipboardEventArgs.cs
- CngKeyCreationParameters.cs
- TerminatorSinks.cs
- KeyValuePair.cs
- DoubleUtil.cs
- EnumBuilder.cs
- FilterQuery.cs
- DataGridViewCellLinkedList.cs
- EntityDataSourceContextCreatedEventArgs.cs
- ListItemCollection.cs
- ObjectStateFormatter.cs
- ComplexType.cs
- ProgressChangedEventArgs.cs
- IntSecurity.cs
- DbProviderManifest.cs
- URIFormatException.cs
- ObjectDataSourceChooseTypePanel.cs
- ScaleTransform.cs
- TogglePatternIdentifiers.cs
- ListBoxChrome.cs
- StreamAsIStream.cs
- XmlQueryContext.cs
- SafeCryptoHandles.cs
- XmlBinaryReaderSession.cs
- FilterableAttribute.cs
- Inline.cs
- ApplicationInfo.cs
- MissingMemberException.cs
- ToolStripContentPanelDesigner.cs
- mactripleDES.cs
- ClientScriptManager.cs
- DesignerTextBoxAdapter.cs
- ClaimSet.cs
- MediaContext.cs
- codemethodreferenceexpression.cs
- DataGridViewImageCell.cs
- DataBoundControlHelper.cs
- DataDocumentXPathNavigator.cs
- IgnoreDeviceFilterElementCollection.cs
- AsyncOperation.cs
- SQLSingleStorage.cs
- WeakRefEnumerator.cs
- cookieexception.cs
- ComponentCollection.cs
- TraceHwndHost.cs
- TripleDESCryptoServiceProvider.cs
- PropertyChangedEventManager.cs
- AutoGeneratedFieldProperties.cs
- FilterableAttribute.cs
- EdgeModeValidation.cs
- AssemblyAttributes.cs
- SocketInformation.cs
- AxisAngleRotation3D.cs
- Mappings.cs
- CategoryNameCollection.cs
- LayoutTable.cs
- ConnectionStringEditor.cs
- User.cs
- ToolStripOverflow.cs
- OperationCanceledException.cs
- EditingMode.cs
- SynchronizedDispatch.cs
- CacheMode.cs
- WebPartConnectionsConfigureVerb.cs
- SemanticTag.cs
- PieceDirectory.cs
- ResourcePool.cs
- GeometryValueSerializer.cs
- PrintDialog.cs
- NativeMethods.cs
- ClientBuildManager.cs