Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

StructuralComparisons.StructuralComparer Property

Gets a predefined object that performs a structural comparison of two objects.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)
static member StructuralComparer : IComparer with get

Property Value

Type: System.Collections.IComparer
A predefined object that is used to perform a structural comparison of two collection objects.

When the IComparer object returned by this property is passed to the comparison method of a collection object, such as Array.IStructuralComparable.CompareTo(Object, IComparer) or Tuple(T1, T2, T3).IStructuralComparable.CompareTo(Object, IComparer), its Compare method is called for each member of an array or for each component of a tuple. This implementation of the Compare method behaves as follows when it compares each item of a collection object with the corresponding item of another collection object:

  • It considers two items that are a null reference (Nothing in Visual Basic) to be equal, and considers a null item to be less than an item that is not null.

  • If the first item in the comparison can be cast to an IStructuralComparable object (in other words, if it is a collection object that implements the IStructuralComparable interface), it calls the CompareTo method.

  • If the first item in the comparison cannot be cast to an IStructuralComparable object (in other words, if it is not a collection object that implements the IStructuralComparable interface), it calls the Comparer.Default.Compare method.

.NET Framework

Supported in: 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.