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
Inherited Members
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
AllItems
Utility enumerator, runs over all non-history items
Declaration
public IEnumerable<ISoListItem> AllItems { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ISoListItem> |
HeadingItems
Return headings and underlying items, empty if this is a flat list or a search
Declaration
public List<ISoListHeading> HeadingItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListHeading> |
HistoryInfo
History information, returns null
Declaration
public HistoryInfo HistoryInfo { get; }
Property Value
Type | Description |
---|---|
HistoryInfo |
HistoryItems
Return history items, empty if this is a flat list or a search
Declaration
public List<ISoListItem> HistoryItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
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 |
RootItems
Return root items, all items in case of a flat list or search
Declaration
public List<ISoListItem> RootItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
Methods
Construct(string, string, int[], bool, string, bool)
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 void Construct(string listName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList)
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. |
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> |
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 |
GetLeadingRootItems(List<ISoListItem>)
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 void GetLeadingRootItems(List<ISoListItem> leadingItems)
Parameters
Type | Name | Description |
---|---|---|
List<ISoListItem> | leadingItems | List to add leading items to |
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 |
ProcessHistoryItem(ISoListItem)
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 void ProcessHistoryItem(ISoListItem item)
Parameters
Type | Name | Description |
---|---|---|
ISoListItem | item | Item, to be updated as you see fit |
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 |