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
- Substitution.cs
- TrueReadOnlyCollection.cs
- WebDisplayNameAttribute.cs
- SystemTcpStatistics.cs
- LicFileLicenseProvider.cs
- ExpandableObjectConverter.cs
- ReachVisualSerializer.cs
- SystemException.cs
- DbParameterCollection.cs
- FilteredAttributeCollection.cs
- backend.cs
- MemberRelationshipService.cs
- MessageQueue.cs
- SafeNativeMethods.cs
- SortFieldComparer.cs
- CssClassPropertyAttribute.cs
- NameValueFileSectionHandler.cs
- WindowsGraphics2.cs
- _ListenerRequestStream.cs
- DebugView.cs
- SQLDouble.cs
- XmlDataSourceView.cs
- Size.cs
- PersonalizationEntry.cs
- CustomDictionarySources.cs
- ToolBarPanel.cs
- StreamReader.cs
- Accessible.cs
- counter.cs
- TextServicesCompartmentContext.cs
- AttributeProviderAttribute.cs
- GeometryHitTestParameters.cs
- MouseCaptureWithinProperty.cs
- ToolStripMenuItem.cs
- ListenUriMode.cs
- BooleanProjectedSlot.cs
- MetadataCache.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- wgx_render.cs
- _SslStream.cs
- Relationship.cs
- XmlUtilWriter.cs
- ChameleonKey.cs
- CommandManager.cs
- IdnElement.cs
- OleDbConnectionInternal.cs
- ActiveXSite.cs
- PixelShader.cs
- CurrentChangingEventManager.cs
- XamlWrappingReader.cs
- CompressEmulationStream.cs
- ImageIndexEditor.cs
- CodeTypeConstructor.cs
- Compiler.cs
- CompilerGeneratedAttribute.cs
- PenContexts.cs
- ValidationError.cs
- DataListGeneralPage.cs
- MailAddress.cs
- Emitter.cs
- OrderedParallelQuery.cs
- SspiHelper.cs
- SqlRowUpdatingEvent.cs
- MultiDataTrigger.cs
- TextElementAutomationPeer.cs
- RelationshipEndCollection.cs
- OrthographicCamera.cs
- TcpProcessProtocolHandler.cs
- DateTime.cs
- OLEDB_Enum.cs
- ExpressionEditorAttribute.cs
- MethodBuilder.cs
- XmlSerializerNamespaces.cs
- OperatorExpressions.cs
- DynamicDataRouteHandler.cs
- XmlCharType.cs
- MutexSecurity.cs
- FastEncoder.cs
- TypeProvider.cs
- FontFamilyValueSerializer.cs
- Point.cs
- ExpressionBindingCollection.cs
- URI.cs
- CheckBoxRenderer.cs
- Condition.cs
- FullTextBreakpoint.cs
- SimpleWebHandlerParser.cs
- ObjectDataSourceEventArgs.cs
- PageAsyncTask.cs
- TextEditorSelection.cs
- StrongTypingException.cs
- AssemblyNameUtility.cs
- XmlWellformedWriter.cs
- FontStretchConverter.cs
- ValidatorCompatibilityHelper.cs
- webproxy.cs
- SubpageParaClient.cs
- DesignerWidgets.cs
- BamlRecordHelper.cs
- PrinterUnitConvert.cs