Show / Hide Table of Contents

Class LiteralsOnlyBase

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Inheritance
object
LiteralsOnlyBase
OperatorProvider
RecordTypeProvider
SaintActivityTypeProvider
SaintTicketStatusProvider
ActiveLanguageProvider
ActivityStatusProvider
AllPreferenceKeysProvider
AppointmentCategoryListProvider
AppointmentCautionWarningProvider
AppointmentCompleted
AppointmentFavouriteListProvider
AppointmentGroupProvider
AppointmentTypeProvider
ArchiveProviderList
AssociateTypeListProvider
CRMScriptProvider
ChatChannelProvider
ChatSessionStatusProvider
ChatUserProvider
ChatbotProvider
ColorIndexProvider
ContactFavouriteListProvider
CreateDocumentTemplatePluginsProvider
CredentialGroupProvider
CustomObjectListProvider
CustomObjectRelationProvider
DashboardEntityList
DashboardTileEntityTypeProvider
DashboardTileListProvider
DayOfMonthProvider
DirectionProvider
DisconnectPersonActionsProvider
DocumentCategoryListProvider
DocumentCompletedProvider
DocumentFavouriteListProvider
DocumentGroupProvider
DocumentHandlerProvider
DocumentTypesListProvider
EjUserProvider
EmailFromTypeProvider
EmailReplyToTypeProvider
ErpConnections
ErpConnectors
EventHandlerTypeProvider
ExecuteOnEventProvider
FaqCategoryProvider
FavouriteTypeListProvider
FilterFutureDateList
FindProduct
FontSizeProvider
FontTypeProvider
FormMailingsProvider
FormProvider
FormSubmissionStatusProvider
FreetextSearchEntityProvider
ImportBlankActionProvider
ImportContactDuplicateMatchProvider
ImportDuplicateActionProvider
ImportDuplicateActionWithoutAddProvider
ImportFieldsProvider
ImportNewListItemProvider
ImportNewPositionItemProvider
ImportNewProductListItemProvider
ImportPersonDuplicateMatchProvider
ImportPhoneUrlsEmailProvider
ImportProductDuplicateMatchProvider
ImportProductFieldsProvider
InvitationTemplateLanguageProvider
Iso6391LanguageProvider
LanguageProvider
MailClientProvider
MailingFavouriteListProvider
MailingStatusProvider
MailingTypeProvider
MergeTagsProvider
MonthProvider
OfMonthProvider
PeriodProvider
PeriodsProvider
PersonContactFavouriteListProvider
PersonFavouriteListProvider
PluginProvider
PrefDescLineProvider
PreferenceKeyProvider
PreferenceLineItemProvider
PreferenceSectionProvider
ProjectFavouriteListProvider
QuoteAlternativeProvider
QuoteApprovers
QuoteConnections
QuoteConnectors
QuoteDocumentGroupFields
QuoteDocumentOrderByFields
QuoteDocumentTypeProvider
QuoteLineStatus
QuoteVersionProvider
QuoteVersionStateListProvider
RatingDiceProvider
RatingNpsProvider
RatingSmileysProvider
RatingStarsProvider
RatingThumbsProvider
RecipientFavoriteListProvider
RecurrenceEveryMonthProvider
RecurrenceWeekCycleProvider
ReplyTemplateProvider
SaleCategoryListProvider
SaleDoneProvider
SaleFavouriteListProvider
SaleStatusProvider
SelectionCriteriaMemberType
SelectionFavouriteListProvider
SelectionMemberTypeClean
SelectionMemberTypeList
SelectionMemberTypeListV2
SelectionMemberWithMailListProvider
SelectionTypeList
SelectionUnionTypeList
SentimentScoreProvider
ShipmentAddrStatusProvider
SimpleMailingStatusProvider
SourceListProvider
SystemEventTypeProvider
TargetEntityTypeProvider
TargetMeasurementUnitProvider
TargetTypeProvider
TargetYearProvider
TemplateVariablesProvider
TicketFavouriteListProvider
TicketOriginProvider
TicketPriorityEscalateEventsProvider
TicketReadStatusProvider
TicketSLevelProvider
TicketStatusProvider
TicketStatusTimeCounterProvider
TimeListProvider
TypeGroupProvider
TypicalSearchProvider
UdefFieldTypeProvider
UdefFieldsProviderBase
VisibleForListProvider
VisibleInMenuProvider
VisibleInProvider
VisibleInTaskProvider
WeekNumberProvider
WeekdayProvider
WorkflowDefinitionStatusProvider
WorkflowGoalTypeProvider
WorkflowInstanceStatusProvider
WorkflowSplitOptionTypeProvider
WorkflowStepTypeProvider
WorkflowTimeWaitAlgorithmProvider
WorkflowTimeWaitIntervalTypeProvider
WorkflowTriggerTypeProvider
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 LiteralsOnlyBase : ISoListProvider, ISoList

Constructors

LiteralsOnlyBase()

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected LiteralsOnlyBase()

Properties

ExtraInfo

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected string ExtraInfo { get; }
Property Value
Type Description
string

ForceFlatList

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected bool ForceFlatList { get; }
Property Value
Type Description
bool

HistoryIds

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected int[] HistoryIds { get; }
Property Value
Type Description
int[]

HistoryInfo

History information for the supported list

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

ListName

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected string ListName { get; }
Property Value
Type Description
string

OnlyReadHistory

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected bool OnlyReadHistory { get; }
Property Value
Type Description
bool

RawHeadingItems

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected List<ISoListHeading> RawHeadingItems { get; }
Property Value
Type Description
List<ISoListHeading>

RawHistoryItems

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected List<ISoListItem> RawHistoryItems { get; }
Property Value
Type Description
List<ISoListItem>

RawRootItems

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected List<ISoListItem> RawRootItems { get; }
Property Value
Type Description
List<ISoListItem>

SearchValue

Base class for making So List providers that represent one single, hard-coded list, i.e., a list where all the items are hard coded and known at compile or run time. Generally, items do not come from the database, though that would always be possible. See the AddItemsAsync(CancellationToken) method for an example subclass implementation.

Declaration
protected string SearchValue { get; set; }
Property Value
Type Description
string

Methods

AddItemsAsync(CancellationToken)

Subclass contract: use the RawRootItems and RawHeadingItems properties to add items to your literals-only list. The base class will then perform any search or flattening required.

Declaration
protected abstract Task AddItemsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

Lists that only contain literals can be either flat or grouped. If you create a grouped list and the caller specifies a forceFlatList attribute, the base class will do the flattening for you.

Examples

This example shows a typical implementation of a literal list, in this case the date interval list from the Filter dialog:

[MDOProviderPlugin( "FilterFutureDate" )]
public class FilterFutureDateList : LiteralsOnlyBase
{
	protected override void AddItems()
	{
		RawRootItems.Add( new SoListItem( 1, "[SR_DATE_RANGE_3MONTHS]", string.Empty, string.Empty ) );
		RawRootItems.Add( new SoListItem( 2, "[SR_DATE_RANGE_4MONTHS]", string.Empty, string.Empty ) );
		RawRootItems.Add( new SoListItem( 3, "[SR_DATE_RANGE_6MONTHS]", string.Empty, string.Empty ) );
		RawRootItems.Add( new SoListItem( 4, "[SR_DATE_RANGE_1YEAR]", string.Empty, string.Empty ) );
		RawRootItems.Add( new SoListItem( 5, "[SR_DATE_RANGE_2YEAR]", string.Empty, string.Empty ) );
	}
}

Note that using a search in this case yields unexpected results. The search is performed on the raw items, which contains resource tags - and that is not what you actually want to search against. So resources + search do not go together.

AddRawRootEnum<TEnum>(TEnum, string, bool)

A helper method for adding items to RawRootItems

Declaration
protected void AddRawRootEnum<TEnum>(TEnum enumValue, string name, bool deleted = false) where TEnum : Enum
Parameters
Type Name Description
TEnum enumValue

The enum value to be used for item ID

string name

Name of an item

bool deleted

if true, don't show in lists unless actually specified

Type Parameters
Name Description
TEnum

The enum type the provider values represent

ClearHistoryItems()

Clears the history items

Declaration
public void ClearHistoryItems()

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

Phase two of two-stage list construction. To be called right after the constructor, at which point all constructors have run, and the class hierarchy is initialized.

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

List name (though note that as implemented by MDOProviderBase, this actually has to be a real table name, so subclasses should override and convert from their list name to a real table name) (yes it's a bit messy)

string additionalInfo

Additional information to provider

int[] historyIDs

Array of history ID's; if non-null, this will BE the history; a non-null but empty array will disable reading of history altogether; a null parameter will cause history to be read from the database.

bool onlyReadHistory

if true, only history will be read.

string searchValue

If non-null, the returned list will be flat and only consist of search matches

bool forceFlatList

If true, the returned list will be flat, though it will still be filtered if grouping/filtering has been set up for the list

CancellationToken cancellationToken
Returns
Type Description
Task

GetHeadingItemsAsync(CancellationToken)

list of headings

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

GetHistoryItemsAsync(CancellationToken)

list of history items

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

GetRootItemsAsync(CancellationToken)

list of root-level items (items not under any heading)

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

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