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
- TrackPointCollection.cs
- VirtualizedItemPattern.cs
- TextPatternIdentifiers.cs
- CheckBoxAutomationPeer.cs
- ContainerActivationHelper.cs
- BeginStoryboard.cs
- SqlOuterApplyReducer.cs
- ProviderManager.cs
- TypeConverterHelper.cs
- DetailsViewUpdateEventArgs.cs
- IntPtr.cs
- ServiceXNameTypeConverter.cs
- ConfigurationManagerHelperFactory.cs
- ReturnType.cs
- StructuralCache.cs
- NavigationFailedEventArgs.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- EventDriven.cs
- DataRowComparer.cs
- DomainUpDown.cs
- ViewManager.cs
- RouteParametersHelper.cs
- PopupRootAutomationPeer.cs
- RemoteWebConfigurationHostServer.cs
- Memoizer.cs
- FileNameEditor.cs
- TableLayoutPanelResizeGlyph.cs
- TTSEvent.cs
- LeftCellWrapper.cs
- IPCCacheManager.cs
- ResourceDescriptionAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- Invariant.cs
- ApplicationException.cs
- SourceChangedEventArgs.cs
- DrawingCollection.cs
- ReadContentAsBinaryHelper.cs
- SqlServer2KCompatibilityAnnotation.cs
- SecurityAttributeGenerationHelper.cs
- DesignerProperties.cs
- XmlDigitalSignatureProcessor.cs
- TabPage.cs
- ExpressionBuilder.cs
- DependencyPropertyValueSerializer.cs
- processwaithandle.cs
- TextTrailingCharacterEllipsis.cs
- BasicBrowserDialog.designer.cs
- EntityTypeEmitter.cs
- HttpConfigurationSystem.cs
- XPathException.cs
- AssemblyInfo.cs
- InputLanguageSource.cs
- SymbolMethod.cs
- StretchValidation.cs
- WindowsListViewGroupHelper.cs
- AnnotationObservableCollection.cs
- Win32MouseDevice.cs
- ConstructorBuilder.cs
- FacetEnabledSchemaElement.cs
- Screen.cs
- TableProvider.cs
- SessionConnectionReader.cs
- DatasetMethodGenerator.cs
- CodeExporter.cs
- ConditionalAttribute.cs
- WebPartCollection.cs
- SQLRoleProvider.cs
- HttpRequestCacheValidator.cs
- Tokenizer.cs
- ConfigurationSectionGroup.cs
- NativeMethods.cs
- printdlgexmarshaler.cs
- DiscoveryProxy.cs
- EncryptedHeaderXml.cs
- PromptBuilder.cs
- ExtendedPropertiesHandler.cs
- BitmapMetadataEnumerator.cs
- CompletionBookmark.cs
- SqlCacheDependencySection.cs
- XPathConvert.cs
- TraceHandlerErrorFormatter.cs
- StylusEventArgs.cs
- JsonWriter.cs
- XpsThumbnail.cs
- Point4D.cs
- BitmapSizeOptions.cs
- SourceFileInfo.cs
- DataGridLinkButton.cs
- ChangeProcessor.cs
- SHA1Managed.cs
- WindowsFormsSectionHandler.cs
- PreservationFileWriter.cs
- CodeAccessPermission.cs
- MappingSource.cs
- LocalizationParserHooks.cs
- HttpHandlerAction.cs
- FocusChangedEventArgs.cs
- CompileLiteralTextParser.cs
- PenThreadWorker.cs
- TextTreeObjectNode.cs