Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Base / Shared / Internal / EqualityArray.cs / 1305376 / EqualityArray.cs
namespace System.Activities.Presentation.Internal { using System.Diagnostics; using System.Runtime; // // An EqualityArray is an array of objects whose // .Equals method runs against all items in the // array. It is assumed that the data input // into the array is constant. We use this in attributes // to offer a quick and accurate TypeId property. // internal class EqualityArray { private object[] _values; internal EqualityArray(params object[] values) { _values = values; Fx.Assert(_values != null && _values.Length > 0, "EqualityArray expects at least one value"); } public override bool Equals(object other) { EqualityArray otherArray = other as EqualityArray; if (otherArray == null) return false; if (otherArray._values.Length != _values.Length) return false; for (int idx = 0; idx < _values.Length; idx++) { if (_values[idx] != otherArray._values[idx]) return false; } return true; } public override int GetHashCode() { return _values[0].GetHashCode(); } } } // 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
- ManagedFilter.cs
- ManagedFilter.cs
- EventlogProvider.cs
- XmlTextReaderImpl.cs
- StringPropertyBuilder.cs
- ScriptModule.cs
- WindowsListBox.cs
- ConditionedDesigner.cs
- BindingContext.cs
- WebPartHelpVerb.cs
- OrderedDictionary.cs
- HwndSubclass.cs
- AccessedThroughPropertyAttribute.cs
- XmlSchemaAppInfo.cs
- PictureBox.cs
- ResourceReader.cs
- InternalConfigEventArgs.cs
- PropertyTabAttribute.cs
- Hashtable.cs
- SerializableTypeCodeDomSerializer.cs
- User.cs
- GenericUriParser.cs
- DocumentViewerBaseAutomationPeer.cs
- CacheHelper.cs
- HttpValueCollection.cs
- UpdateRecord.cs
- TrustManager.cs
- PageParserFilter.cs
- RectangleF.cs
- OutputCacheModule.cs
- OutputCacheSettingsSection.cs
- StringResourceManager.cs
- CommentGlyph.cs
- TextBoxAutoCompleteSourceConverter.cs
- RegionInfo.cs
- BaseDataBoundControl.cs
- ProfileManager.cs
- Pointer.cs
- ToolStripGrip.cs
- COM2ExtendedUITypeEditor.cs
- CharStorage.cs
- Math.cs
- ManagementOptions.cs
- WrappedIUnknown.cs
- ExpressionNode.cs
- LostFocusEventManager.cs
- SafeProcessHandle.cs
- SqlCharStream.cs
- SecurityTokenProvider.cs
- ArraySubsetEnumerator.cs
- arc.cs
- SqlDataSourceCache.cs
- StringValueConverter.cs
- KeyProperty.cs
- MenuItemBinding.cs
- SByteStorage.cs
- PersonalizationStateInfoCollection.cs
- HScrollProperties.cs
- DataGridTableStyleMappingNameEditor.cs
- HttpResponseHeader.cs
- TemplatedEditableDesignerRegion.cs
- ListBindingHelper.cs
- dtdvalidator.cs
- QilStrConcat.cs
- GeneralTransform3DGroup.cs
- securestring.cs
- JoinTreeSlot.cs
- LoginName.cs
- UnSafeCharBuffer.cs
- EdmToObjectNamespaceMap.cs
- AppSettingsExpressionBuilder.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- FormViewUpdateEventArgs.cs
- IxmlLineInfo.cs
- ButtonBaseAdapter.cs
- xmlsaver.cs
- safelink.cs
- OracleColumn.cs
- PolyBezierSegmentFigureLogic.cs
- DayRenderEvent.cs
- ProfileGroupSettings.cs
- TypeGeneratedEventArgs.cs
- RegexBoyerMoore.cs
- Model3DGroup.cs
- VirtualPathData.cs
- DummyDataSource.cs
- PolicyReader.cs
- SqlClientMetaDataCollectionNames.cs
- CodeIdentifiers.cs
- Query.cs
- FileFormatException.cs
- SplitContainer.cs
- Command.cs
- XmlMemberMapping.cs
- PersonalizationProviderCollection.cs
- CommonDialog.cs
- ReferenceService.cs
- DoubleCollection.cs
- StructuredCompositeActivityDesigner.cs
- ExceptQueryOperator.cs