Show / Hide Table of Contents

Class ListWithLiteralItemsBase

Base class for MDO lists that are based on an existing list, but need to add leading or trailing root items. This is typical for lists like the probability in the search dialog, amount class for SAINT criteria, etc.

The template method pattern is used; override the virtual methods you need to do your stuff. Methods you do not override will revert to their empty base implementation.
Inheritance
object
ListWithLiteralItemsBase
SaintAmountClassProvider
SaintIntentionProvider
SaleProbability
SaleSource
UserGroupWithHistoryAllProvider
Implements
ISoListProvider
ISoList
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.dll
Syntax
public abstract class ListWithLiteralItemsBase : ISoListProvider, ISoList

Constructors

ListWithLiteralItemsBase()

Base class for MDO lists that are based on an existing list, but need to add leading or trailing root items. This is typical for lists like the probability in the search dialog, amount class for SAINT criteria, etc.

The template method pattern is used; override the virtual methods you need to do your stuff. Methods you do not override will revert to their empty base implementation.
Declaration
protected ListWithLiteralItemsBase()

Properties

HistoryInfo

History information, returns null

Declaration
public HistoryInfo HistoryInfo { get; }
Property Value
Type Description
HistoryInfo

InnerList

MainTableName to give access to the inner list, ie., the provider of the inner MDO list you wish to extend

Declaration
protected ISoListProvider InnerList { get; }
Property Value
Type Description
ISoListProvider

Methods

ClearHistoryItems()

Clears the history items

Declaration
public void ClearHistoryItems()

ConstructAsync(string, string, int[], bool, string, bool, CancellationToken)

Construct the list, by using the derived class' InnerListProviderName property to call the SoListProviderFactory. The various virtual methods are called, and the final list constructed.

Declaration
public Task ConstructAsync(string listName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string listName

Name of the desired list, passed to the derived class

string additionalInfo
int[] historyIDs

List of history id's (primary keys of the table holding the MDO list values).

bool onlyReadHistory

Only read history nodes.

string searchValue

Search value (case insensetive string used like '[searchValue]%'. The result when using this is allways a flat list without hisotry elements.

bool forceFlatList

State that a forced flat list should be returned.

CancellationToken cancellationToken
Returns
Type Description
Task

FilterBySearchValue(IEnumerable<ISoListItem>)

Base class for MDO lists that are based on an existing list, but need to add leading or trailing root items. This is typical for lists like the probability in the search dialog, amount class for SAINT criteria, etc.

The template method pattern is used; override the virtual methods you need to do your stuff. Methods you do not override will revert to their empty base implementation.
Declaration
public IEnumerable<ISoListItem> FilterBySearchValue(IEnumerable<ISoListItem> items)
Parameters
Type Name Description
IEnumerable<ISoListItem> items
Returns
Type Description
IEnumerable<ISoListItem>

GetAllItemsAsync(CancellationToken)

Utility enumerator, runs over all non-history items

Declaration
public IAsyncEnumerable<ISoListItem> GetAllItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerable<ISoListItem>

GetHeadingItemsAsync(CancellationToken)

Return headings and underlying items, empty if this is a flat list or a search

Declaration
public Task<List<ISoListHeading>> GetHeadingItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListHeading>>

GetHistoryItemsAsync(CancellationToken)

Return history items, empty if this is a flat list or a search

Declaration
public Task<List<ISoListItem>> GetHistoryItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListItem>>

GetInnerListAdditionalInfo(string)

Base class for MDO lists that are based on an existing list, but need to add leading or trailing root items. This is typical for lists like the probability in the search dialog, amount class for SAINT criteria, etc.

The template method pattern is used; override the virtual methods you need to do your stuff. Methods you do not override will revert to their empty base implementation.
Declaration
protected virtual string GetInnerListAdditionalInfo(string additionalInfo)
Parameters
Type Name Description
string additionalInfo
Returns
Type Description
string

GetInnerListProviderName(string)

Subclass contract: Return the name of the desired inner provider; this will be passed to the SoListProviderFactory.

Declaration
protected abstract string GetInnerListProviderName(string outerListname)
Parameters
Type Name Description
string outerListname

List name from the client code, useful if one class is to extend more than one list

Returns
Type Description
string

GetLeadingRootItemsAsync(List<ISoListItem>, CancellationToken)

Subclass contract: Override this method to provide leading root items. Add your items to the list that is passed in. If you do not need to add leading items, do not override this method.

Declaration
protected virtual Task GetLeadingRootItemsAsync(List<ISoListItem> leadingItems, CancellationToken cancellationToken = default)
Parameters
Type Name Description
List<ISoListItem> leadingItems

List to add leading items to

CancellationToken cancellationToken
Returns
Type Description
Task

GetRootItemsAsync(CancellationToken)

Return root items, all items in case of a flat list or search

Declaration
public Task<List<ISoListItem>> GetRootItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<List<ISoListItem>>

GetTrailingRootItems(List<ISoListItem>)

Subclass contract: Override this method to provide trailing root items. Add your items to the list that is passed in. If you do not need to add trailing items, do not override this method.

Declaration
protected virtual void GetTrailingRootItems(List<ISoListItem> trailingItems)
Parameters
Type Name Description
List<ISoListItem> trailingItems

List to add trailing items to

ProcessHistoryItemAsync(ISoListItem, CancellationToken)

Subclass contract: Override this method to manipulate each history item. This method will be called once for each history item. If you do not need to manipulate items, do not override this method.

Note - items are not re-sorted, so chaning the rank may not have any effect.
Declaration
protected virtual Task ProcessHistoryItemAsync(ISoListItem item, CancellationToken cancellationToken = default)
Parameters
Type Name Description
ISoListItem item

Item, to be updated as you see fit

CancellationToken cancellationToken
Returns
Type Description
Task

ProcessItem(ISoListItem)

Subclass contract: Override this method to manipulate each root item (after leading and trailing items have been added). This method will be called once for each non-history item. If you do not need to manipulate items, do not override this method.

Note - items are not re-sorted, so chaning the rank may not have any effect.
Declaration
protected virtual void ProcessItem(ISoListItem item)
Parameters
Type Name Description
ISoListItem item

Item, to be updated as you see fit

Implements

ISoListProvider
ISoList

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top