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
- ProviderMetadataCachedInformation.cs
- ApplicationSecurityManager.cs
- ListBoxItemAutomationPeer.cs
- TextDecorationCollection.cs
- ProcessRequestArgs.cs
- OrderedDictionary.cs
- QueryCacheManager.cs
- ScriptResourceMapping.cs
- DSASignatureFormatter.cs
- CompositionAdorner.cs
- JpegBitmapEncoder.cs
- IProducerConsumerCollection.cs
- BoolExpressionVisitors.cs
- SimpleRecyclingCache.cs
- DbParameterCollectionHelper.cs
- FilterInvalidBodyAccessException.cs
- OracleRowUpdatedEventArgs.cs
- ConfigurationManagerHelperFactory.cs
- EntityKey.cs
- XmlDocumentType.cs
- UserControl.cs
- Viewport3DVisual.cs
- SHA384Managed.cs
- RecordsAffectedEventArgs.cs
- EventLogWatcher.cs
- Configuration.cs
- ImageAnimator.cs
- InvalidComObjectException.cs
- ArrayList.cs
- XmlnsCache.cs
- BrowserDefinitionCollection.cs
- WebServiceData.cs
- SafeArrayTypeMismatchException.cs
- CompilerGlobalScopeAttribute.cs
- PageCatalogPartDesigner.cs
- Ports.cs
- BindingManagerDataErrorEventArgs.cs
- DATA_BLOB.cs
- BindToObject.cs
- WindowsSlider.cs
- CustomWebEventKey.cs
- XmlUtil.cs
- DoubleCollectionConverter.cs
- GlobalizationAssembly.cs
- SQLDateTimeStorage.cs
- RuntimeCompatibilityAttribute.cs
- RoleService.cs
- GlobalizationAssembly.cs
- FilterQueryOptionExpression.cs
- ExpressionEditorAttribute.cs
- Size.cs
- ListViewItem.cs
- CompensableActivity.cs
- FacetDescriptionElement.cs
- LayoutEngine.cs
- MessageDesigner.cs
- ServiceNameCollection.cs
- TdsRecordBufferSetter.cs
- OdbcDataAdapter.cs
- Metafile.cs
- X509Certificate.cs
- GenericXmlSecurityTokenAuthenticator.cs
- CommonDialog.cs
- MetaModel.cs
- DeleteWorkflowOwnerCommand.cs
- DataBindingHandlerAttribute.cs
- LineMetrics.cs
- TripleDES.cs
- OleDbError.cs
- FrameworkPropertyMetadata.cs
- SerialReceived.cs
- DataGridHeaderBorder.cs
- TemplateManager.cs
- StylusPointPropertyInfoDefaults.cs
- Roles.cs
- PolyQuadraticBezierSegment.cs
- HashUtility.cs
- RuleSettingsCollection.cs
- TableColumnCollectionInternal.cs
- WaitHandle.cs
- XMLSchema.cs
- SessionPageStateSection.cs
- StreamingContext.cs
- WinOEToolBoxItem.cs
- BaseCollection.cs
- CachedBitmap.cs
- ImageDrawing.cs
- BinaryFormatterWriter.cs
- DiscoveryClientRequestChannel.cs
- EntityStoreSchemaGenerator.cs
- SerializationSectionGroup.cs
- CompressEmulationStream.cs
- XmlWellformedWriterHelpers.cs
- Imaging.cs
- ThreadPoolTaskScheduler.cs
- OleDbPropertySetGuid.cs
- IisTraceListener.cs
- NonVisualControlAttribute.cs
- DiagnosticTraceSource.cs
- ConsumerConnectionPointCollection.cs