Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / 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; // This is the algorithm used in Whidbey to combine hashcodes. // It adheres better than a simple XOR to the randomness requirement for hashcodes. int hash = _items[0].GetHashCode(); for (int i = 1; i < _items.Length; i++) { hash = HashCodeCombiner.CombineHashCodes(hash, _items[i].GetHashCode()); } return hash; } 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PrimitiveXmlSerializers.cs
- GraphicsContainer.cs
- SpecialFolderEnumConverter.cs
- FormatPage.cs
- LinqToSqlWrapper.cs
- FixedStringLookup.cs
- DynamicControlParameter.cs
- DocumentSchemaValidator.cs
- ReaderContextStackData.cs
- glyphs.cs
- HTMLTagNameToTypeMapper.cs
- ParameterCollection.cs
- DrawTreeNodeEventArgs.cs
- SubtreeProcessor.cs
- ConfigXmlDocument.cs
- SqlBuffer.cs
- MaskedTextBoxTextEditor.cs
- DelimitedListTraceListener.cs
- DataServiceCollectionOfT.cs
- AuthenticationSection.cs
- SerializerWriterEventHandlers.cs
- Pen.cs
- ReflectEventDescriptor.cs
- EdmConstants.cs
- SystemNetworkInterface.cs
- FlowDocumentScrollViewer.cs
- ModelChangedEventArgsImpl.cs
- DesignTimeTemplateParser.cs
- ArglessEventHandlerProxy.cs
- FixUp.cs
- RightNameExpirationInfoPair.cs
- IxmlLineInfo.cs
- httpstaticobjectscollection.cs
- SqlDataSourceFilteringEventArgs.cs
- Style.cs
- ExpandCollapsePattern.cs
- WebConfigurationHostFileChange.cs
- MediaEntryAttribute.cs
- ReliabilityContractAttribute.cs
- Matrix3DConverter.cs
- GifBitmapEncoder.cs
- ClientConfigurationSystem.cs
- WorkflowWebHostingModule.cs
- SqlParameter.cs
- View.cs
- GlobalEventManager.cs
- AuthenticatingEventArgs.cs
- ProgressBarRenderer.cs
- ServiceDescription.cs
- ACE.cs
- ObjectDataSourceMethodEditor.cs
- ButtonChrome.cs
- SmiMetaDataProperty.cs
- IisNotInstalledException.cs
- SettingsPropertyNotFoundException.cs
- DiscreteKeyFrames.cs
- LinqDataSourceStatusEventArgs.cs
- CodePageEncoding.cs
- FrameworkTextComposition.cs
- HandledEventArgs.cs
- ToolboxItemWrapper.cs
- EditorBrowsableAttribute.cs
- MethodBody.cs
- ListViewUpdatedEventArgs.cs
- milexports.cs
- NamespaceList.cs
- MimePart.cs
- ToolBarButton.cs
- BrowserCapabilitiesFactoryBase.cs
- EnumMember.cs
- RangeEnumerable.cs
- EdmFunction.cs
- OracleConnectionStringBuilder.cs
- ControlBuilder.cs
- NameValueCollection.cs
- Expression.cs
- FrameworkTextComposition.cs
- HandlerFactoryWrapper.cs
- FormViewInsertedEventArgs.cs
- WebPartZoneBase.cs
- AssemblyLoader.cs
- ReflectionPermission.cs
- DataGridTableCollection.cs
- UIElement.cs
- TemplateBindingExtension.cs
- DrawingServices.cs
- NamedObject.cs
- IisTraceWebEventProvider.cs
- SecurityMode.cs
- HttpMethodConstraint.cs
- XmlEncoding.cs
- MediaPlayerState.cs
- CollectionTraceRecord.cs
- PolyLineSegment.cs
- StreamHelper.cs
- QueryGeneratorBase.cs
- ReliableOutputConnection.cs
- IdnElement.cs
- WaveHeader.cs
- InstanceLockedException.cs