OrderableHelper Class
Provides numerous utility methods for working with IOrderable objects.
public static class OrderableHelper
- Inheritance:
- object object
Methods
Sort<T>(IEnumerable<T>)
Returns a sorted array of IOrderable items.
public static T[] Sort<T>(IEnumerable<T> unsortedItems) where T : IOrderable
- Type Parameters:
-
T
-The item type.
Parameter | Type | Description |
---|---|---|
unsortedItems | IEnumerable<T> | The collection of unsorted IOrderable items. |
Returns
- T[]:
A sorted array of IOrderable items.
Sort<T>(IEnumerable<T>, Comparison<T>, Comparison<T>)
Sorts a list of items, giving precedence to IOrderable items.
public static T[] Sort<T>(IEnumerable<T> unsortedItems, Comparison<T> preComparison, Comparison<T> fallbackComparison)
- Type Parameters:
-
T
-The item type.
Parameter | Type | Description |
---|---|---|
unsortedItems | IEnumerable<T> | The collection of unsorted items. |
preComparison | Comparison<T> | An optional comparison that executes before the default logic. |
fallbackComparison | Comparison<T> | An optional fallback comparison delegate. |
Returns
- T[]:
A sorted array of items.