Description
Have Item and For Each enumerator return the McDBNode instances of this collection in a sorted order.
-
Return Type
-
None
-
Syntax
-
object.AddSortOrder [SortKey], [Order]
The AddSortOrder Method syntax has these parts: |
| object | An expression evaluating to an object of type McDBNodes. | | SortKey | Optional. A mcDBSortItem enumeration, as described in settings. The key (aspect/property) of the McDBNode instances in this collection that orders their sorting.
| | Order | Optional. A mcDBOrdering enumeration, as described in settings. Whether items are sorted on the SortKey are in mcdbAscending or mcdbDescending order. The value mcdbNone is valid, but has no effect when passed for this parameter.
| Settings The settings for SortKey are:
 | mcdbName | 0 |
Sort by Name
|
 | mcdbCreator | 1 |
Sort by Creator
|
 | mcdbCreateDate | 2 |
Sort by Date Created
|
 | mcdbModifier | 3 |
Sort by Modifier
|
 | mcdbModifyDate | 4 |
Sort by Date Modified
|
 | mcdbTypeName | 5 |
Sort by Name of McDBType
|
 | mcdbAttributeValue | 6 |
Sort by Named Attribute [Value] (not valid for McDBNodes.AddSortOrder)
|
 | mcdbCategory | 7 |
Sort by Category
|
 | mcdbDataString | 8 |
Sort by Strings in Data Property
|
The settings for Order are:
 | mcdbAscending | 0 |
Sort in Ascending Order
|
 | mcdbDescending | 1 |
Sort in Descending Order
|
 | mcdbNone | 2 |
Do not Sort
|
Remarks
A McDBNodes collection will return its McDBNode Item instance(s) in sorted order after calling this method. Sort order specifications (calls to AddSortOrder) are addative. Therefore, to change the sort ordering on a collection, first call the ClearSortOrder method, then all of the desired sort order specifications may be added with AddSortOrder.
Exceptions
Notes
Sort orders are applied in the order added. That is, the first call to AddSortOrder sets a primary sorting key, and subsequent call(s) specify secondary sorting key(s) (i.e. only used as a tiebreaker for equal values of the more primary sorting key(s)). The SortKey mcdbAttributeValue may not be specified for McDBNodes.AddSortOrder, only McDBQuery.AddSortOrder. Further, the SortKey mcdbTypeName, is always the lowest priority order for sorting. That is, when multiple calls to AddSortOrder are made, the McDBType.Name will always be the last tiebreaker, regardless of when in the sequence of calls to AddSortOrder it is made.
|