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
- SmiXetterAccessMap.cs
- DrawTreeNodeEventArgs.cs
- SmtpNegotiateAuthenticationModule.cs
- NetworkCredential.cs
- ZipIOCentralDirectoryBlock.cs
- PeerContact.cs
- XsltInput.cs
- OdbcPermission.cs
- DefaultBinder.cs
- DefaultTextStore.cs
- DrawingContextWalker.cs
- HttpCachePolicyElement.cs
- Font.cs
- BaseTemplateBuildProvider.cs
- SmtpNegotiateAuthenticationModule.cs
- Light.cs
- CompModSwitches.cs
- KoreanCalendar.cs
- ObjectCloneHelper.cs
- PropertyBuilder.cs
- RewritingSimplifier.cs
- loginstatus.cs
- Triplet.cs
- ContentDesigner.cs
- WebRequestModuleElement.cs
- ClientTargetSection.cs
- PartialToken.cs
- CharAnimationBase.cs
- ParallelTimeline.cs
- Italic.cs
- AggregateNode.cs
- RouteUrlExpressionBuilder.cs
- DiscoveryClientDuplexChannel.cs
- ManifestBasedResourceGroveler.cs
- MarkupExtensionParser.cs
- DataSourceSelectArguments.cs
- SystemTcpConnection.cs
- IPAddress.cs
- ReaderOutput.cs
- BufferAllocator.cs
- MD5.cs
- SocketManager.cs
- CaseStatementProjectedSlot.cs
- TextTreePropertyUndoUnit.cs
- MonthChangedEventArgs.cs
- CopyOnWriteList.cs
- CacheVirtualItemsEvent.cs
- TypedTableGenerator.cs
- CacheOutputQuery.cs
- CommonDialog.cs
- SmtpNtlmAuthenticationModule.cs
- QilChoice.cs
- HttpWebResponse.cs
- HtmlForm.cs
- ListBindingConverter.cs
- DataGridTableCollection.cs
- Debugger.cs
- TimeSpan.cs
- Model3D.cs
- RijndaelManagedTransform.cs
- PlainXmlSerializer.cs
- SmiMetaData.cs
- SafeSecurityHandles.cs
- SystemWebCachingSectionGroup.cs
- StaticExtensionConverter.cs
- Int32.cs
- RangeValidator.cs
- BaseParser.cs
- ProviderBase.cs
- ItemCheckEvent.cs
- BamlMapTable.cs
- AggregateNode.cs
- Stack.cs
- PerformanceCounterPermissionAttribute.cs
- SHA1.cs
- CodeSubDirectoriesCollection.cs
- ReflectionUtil.cs
- FormViewRow.cs
- DefaultTraceListener.cs
- XmlSchemaSimpleContent.cs
- ParameterCollection.cs
- CheckBoxList.cs
- GridViewRowCollection.cs
- SqlDataSourceCache.cs
- InlinedAggregationOperator.cs
- _OSSOCK.cs
- DataGridTable.cs
- IsolatedStorageFilePermission.cs
- FusionWrap.cs
- SrgsToken.cs
- CustomAttribute.cs
- StandardBindingOptionalReliableSessionElement.cs
- ConsoleKeyInfo.cs
- XmlNamespaceDeclarationsAttribute.cs
- shaper.cs
- Compilation.cs
- GridViewPageEventArgs.cs
- ProcessModuleDesigner.cs
- DataGridViewCellStyleConverter.cs
- BuilderPropertyEntry.cs