SPContentTypeId.IComparable.CompareTo method

Compares the current instance with another object of the same type.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Private Function CompareTo ( _
    o As Object _
) As Integer Implements IComparable.CompareTo
'Usage
Dim instance As SPContentTypeId
Dim o As Object
Dim returnValue As Integer

returnValue = CType(instance, IComparable).CompareTo(o)
intIComparable.CompareTo(
    Object o
)

Parameters

  • o
    Type: System.Object

    An object to compare with the current SPContentTypeId object. If the object that is passed as an argument cannot be cast as type SPContentTypeId, the method throws an ArgumentException.

Return value

Type: System.Int32
A value that indicates the relative order of the objects that are being compared. The return value has these meanings:

Value

Meaning

Less than zero

The current content type ID precedes o in the sort order.

Zero

The current content type ID occurs in the same position in the sort order as o.

Greater than zero

The current content type ID follows o in the sort order.

Implements

IComparable.CompareTo(Object)

Exceptions

Exception Condition
ArgumentException

o is not an SPContentTypeId.

Remarks

This method is an explicit implementation of the IComparable.CompareTo method. It is implemented so that it can be called automatically by methods of non-generic collection objects, such as Sort, to order each member of the array.

See also

Reference

SPContentTypeId structure

SPContentTypeId members

Microsoft.SharePoint namespace

CompareTo(SPContentTypeId)