Class SelectableListHelper
Utility class to help with the conversion of standard MDO lists to Selectable lists, and extracting selected ids from selectable lists. Contains only static methods.
Inherited Members
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.dll
Syntax
public static class SelectableListHelper
Methods
ConvertToSelectableAsync(ISoListProvider, int[], CancellationToken)
Convert an ISoListProvider into an equivalent set of root, heading and history items, where each item conforms to the ISelectableListItem interface. If an array of id's to be selected is also provided, all elements corresponding to those id's will have the Selected attribute set to true.
Declaration
public static Task<(List<ISoListItem> rootItems, List<ISoListHeading> headingItems, List<ISoListItem> historyItems)> ConvertToSelectableAsync(ISoListProvider source, int[] selectedIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ISoListProvider | source | Source list provider |
| int[] | selectedIds | Array of ID's to select, can be null |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<(List<ISoListItem> rootItems, List<ISoListHeading> headingItems, List<ISoListItem> historyItems)> |
GetAllIdsAsync(ISoListProvider, CancellationToken)
Utility class to help with the conversion of standard MDO lists to Selectable lists, and extracting selected ids from selectable lists. Contains only static methods.
Declaration
public static Task<int[]> GetAllIdsAsync(ISoListProvider provider, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ISoListProvider | provider | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int[]> |
GetSelectedIds(List<ISoListItem>, List<ISoListHeading>, List<ISoListItem>)
Extract the selected items' id's from a root, heading and history list. Any combination if input parameters can be null. Any items can be passed in, but only ISelectableListItem items contain a Selected attribute and can contribute to the result. The result is unique by ID, but not sorted.
Declaration
public static int[] GetSelectedIds(List<ISoListItem> rootItems, List<ISoListHeading> headingItems, List<ISoListItem> historyItems)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ISoListItem> | rootItems | Root items to analyze, can be null |
| List<ISoListHeading> | headingItems | Heading items to analyze, can be null |
| List<ISoListItem> | historyItems | History items to analyze, can be null |
Returns
| Type | Description |
|---|---|
| int[] |
GetSelectedIdsAsync(ISoListProvider, CancellationToken)
Extract the selected items' id's from a provider that produces selectable items. Any items can be passed in, but only ISelectableListItem items contain a Selected attribute and can contribute to the result. The result is unique by ID, but not sorted.
Declaration
public static Task<int[]> GetSelectedIdsAsync(ISoListProvider selectableProvider, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ISoListProvider | selectableProvider | Provider, whose lists are to be analyzed |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int[]> | ID's of items that had Selected==true |