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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlLinkedNode.cs
- DataBindingCollection.cs
- _SSPISessionCache.cs
- Renderer.cs
- SynchronizedInputHelper.cs
- SurrogateSelector.cs
- CompoundFileReference.cs
- InputScopeConverter.cs
- SecurityTokenAuthenticator.cs
- Cursors.cs
- SqlCachedBuffer.cs
- objectquery_tresulttype.cs
- TrackingMemoryStream.cs
- DataListItemCollection.cs
- CodeDirectionExpression.cs
- ISessionStateStore.cs
- FileNameEditor.cs
- SmiXetterAccessMap.cs
- Size3D.cs
- PageFunction.cs
- SafeEventLogWriteHandle.cs
- PlanCompiler.cs
- WindowsGrip.cs
- HwndSubclass.cs
- PropertyGridCommands.cs
- CounterSampleCalculator.cs
- LabelInfo.cs
- Duration.cs
- OAVariantLib.cs
- AuthorizationRuleCollection.cs
- URLString.cs
- InboundActivityHelper.cs
- PriorityBinding.cs
- TreeNodeConverter.cs
- TypeSource.cs
- CodeIndexerExpression.cs
- WS2007FederationHttpBinding.cs
- ContextMenuService.cs
- UnknownBitmapDecoder.cs
- TrackingWorkflowEventArgs.cs
- SqlDataSourceEnumerator.cs
- LazyTextWriterCreator.cs
- DataGridViewRowsAddedEventArgs.cs
- EntityDataSourceEntitySetNameItem.cs
- QualifiedCellIdBoolean.cs
- ProcessHost.cs
- ViewKeyConstraint.cs
- SiteMapNodeItemEventArgs.cs
- InfoCardSymmetricAlgorithm.cs
- TypeCodeDomSerializer.cs
- HiddenField.cs
- WebPartTransformerCollection.cs
- HttpResponse.cs
- FileLevelControlBuilderAttribute.cs
- UserNameServiceElement.cs
- SetterBaseCollection.cs
- WindowsFormsHost.cs
- DbConnectionClosed.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- ActivitySurrogateSelector.cs
- PrimitiveXmlSerializers.cs
- Win32.cs
- DbParameterHelper.cs
- RegistryKey.cs
- HttpServerVarsCollection.cs
- ClientBuildManagerCallback.cs
- BypassElementCollection.cs
- EllipseGeometry.cs
- SortQuery.cs
- GroupStyle.cs
- TdsValueSetter.cs
- SynchronizationFilter.cs
- LocalizabilityAttribute.cs
- MarginsConverter.cs
- Script.cs
- Int32CAMarshaler.cs
- SqlConnectionPoolProviderInfo.cs
- ComponentManagerBroker.cs
- XomlCompilerError.cs
- ACE.cs
- LocalizationComments.cs
- XmlValidatingReaderImpl.cs
- EventData.cs
- ToolStripItemRenderEventArgs.cs
- SendMailErrorEventArgs.cs
- TemplateFactory.cs
- Timer.cs
- HybridDictionary.cs
- ListControlDataBindingHandler.cs
- RequestCacheValidator.cs
- GetPageCompletedEventArgs.cs
- ObjectDataSourceView.cs
- UndirectedGraph.cs
- MonitorWrapper.cs
- EntityDescriptor.cs
- HMACSHA512.cs
- PrivacyNoticeBindingElementImporter.cs
- DateTimeConstantAttribute.cs
- InsufficientMemoryException.cs
- WebBrowserPermission.cs