Search Results for

    Show / Hide Table of Contents

    Class FormulaFunctionsWithViewModel<T>

    The context supplied while executing a formula that has a custom context item, and a view that it operates against

    This context is mainly used against formulas that configure and work against a view itself, such as ones that can specify if a view is visible dynamically, or more.

    Inheritance
    object
    StandardFunctions
    FormulaFunctions
    FormulaFunctionsWithUpdater
    FormulaFunctionsWithContext<T>
    FormulaFunctionsWithViewModel<T>
    FormulaFunctionsWithViewContext<T>
    FormulaFunctionsWithViewModel
    Implements
    IFormulaFunctionsWithViewModel<T>
    IFormulaFunctionsWithViewModel
    IFormulaFunctionsWithContext<T>
    IFormulaFunctionsWithContext
    IFormulaFunctions
    Inherited Members
    FormulaFunctionsWithContext<T>.TestEvents()
    FormulaFunctionsWithContext<T>.ItemAs<T1>()
    FormulaFunctionsWithContext<T>.SetExtendedPropertyValue(IBaseEntity, string, string, object)
    FormulaFunctionsWithContext<T>.GetValue(string)
    FormulaFunctionsWithContext<T>.GetValue<T2>(string)
    FormulaFunctionsWithContext<T>.GetAnswerTotal(string)
    FormulaFunctionsWithContext<T>.GetContextType(EntityDescriptor)
    FormulaFunctionsWithContext<T>.MyItem
    FormulaFunctionsWithContext<T>.Item
    FormulaFunctionsWithContext<T>.PropertyChangedItem
    FormulaFunctionsWithContext<T>.PropertyChangedName
    FormulaFunctionsWithContext<T>.PropertyChangedAlias
    FormulaFunctionsWithContext<T>.ChangedItemType
    FormulaFunctionsWithUpdater.SetCustomParameters(Dictionary<string, object>)
    FormulaFunctionsWithUpdater.CreateNewData()
    FormulaFunctionsWithUpdater.CreateNewItem(string)
    FormulaFunctionsWithUpdater.CreateNewItem<T>()
    FormulaFunctionsWithUpdater.GetCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValue(string)
    FormulaFunctionsWithUpdater.HasCustomParamValueEqualTo(string, object)
    FormulaFunctionsWithUpdater.RunCodeSnippet(string, params string[])
    FormulaFunctionsWithUpdater.MyData
    FormulaFunctions.ShareThisQueryCacheWithTarget(IFormulaFunctions)
    FormulaFunctions.SetQueryRunnerHelper(Func<IEntityUpdater, ISQLWrapperInterpretor, Dictionary<string, string>, QueryableExecuter<ISQLWrapperResult>, Task<DataRow[]>>)
    FormulaFunctions.GetItemPropertyValue(object, string)
    FormulaFunctions.GetTaskID(string)
    FormulaFunctions.GetTaskParameter(string)
    FormulaFunctions.SetObjectValue(object, string, object)
    FormulaFunctions.GetObjectValue(object, string)
    FormulaFunctions.GetExtendedPropertyValue(IBaseEntity, string, string)
    FormulaFunctions.GetExtendedPropertyItem(IBaseEntity, string)
    FormulaFunctions.GetExtendedObject(IBaseEntity, string, bool)
    FormulaFunctions.GetEntityTypeID(string)
    FormulaFunctions.Evaluate<T>(string, bool)
    FormulaFunctions.IsValid<T>(string)
    FormulaFunctions.IsValid<T>(string, Type)
    FormulaFunctions.GetContextItemType(object)
    FormulaFunctions.GetItemFromDataSourceID(string, string)
    FormulaFunctions.GetItemFromDataSourceID(string, string, string)
    FormulaFunctions.GetItem(string, Guid)
    FormulaFunctions.GetItemAs<T>(Guid)
    FormulaFunctions.GetItems(string, QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem(string, QueryableFilter)
    FormulaFunctions.GetItems(string, string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem(string, string, SQLOperator, object)
    FormulaFunctions.GetItems<T>(QueryableFilter)
    FormulaFunctions.GetFirstOrDefaultItem<T>(QueryableFilter)
    FormulaFunctions.GetItems<T>(string, SQLOperator, object)
    FormulaFunctions.GetFirstOrDefaultItem<T>(string, SQLOperator, object)
    FormulaFunctions.GetEnumValue(object)
    FormulaFunctions.GetEnumCode(object)
    FormulaFunctions.XIRR(string, string, string, params string[])
    FormulaFunctions.XIRR(string, string, string, (string, object)[], params string[])
    FormulaFunctions.TWR(string, string, string, string, params string[])
    FormulaFunctions.TWRRow(string, string, string, string, params string[])
    FormulaFunctions.RunQuery(string, string, params string[])
    FormulaFunctions.HasQueryResult(string, params string[])
    FormulaFunctions.GetQueryResult(ISQLWrapperResult, string)
    FormulaFunctions.GetQueryResult(DataRow, string)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult)
    FormulaFunctions.GetQueryResult(string, string, DataRow)
    FormulaFunctions.GetQueryResult(string, string, ISQLWrapperResult[], string, object)
    FormulaFunctions.RunQueryResult(string, params string[])
    FormulaFunctions.RunDRQueryResult(string, params string[])
    FormulaFunctions.LogInfo(string, params object[])
    FormulaFunctions.LogError(Exception, string, params object[])
    FormulaFunctions.GetQueryCount(string, string, string)
    FormulaFunctions.GetQueryItems(string, string, string, string)
    FormulaFunctions.GetDRQueryItems(string, string, string, string)
    FormulaFunctions.Data
    FormulaFunctions.Cache
    FormulaFunctions.Services
    FormulaFunctions.User
    StandardFunctions.FormatAsString(object)
    StandardFunctions.Null()
    StandardFunctions.IsNull(object)
    StandardFunctions.Not(bool)
    StandardFunctions.Or(bool, bool)
    StandardFunctions.And(bool, bool)
    StandardFunctions.Sin(double)
    StandardFunctions.Cos(double)
    StandardFunctions.Now()
    StandardFunctions.Today()
    StandardFunctions.TodayString()
    StandardFunctions.EndOfMonth(DateTime)
    StandardFunctions.BeginningOfMonth(DateTime)
    StandardFunctions.BeginningOfWeek(DateTime)
    StandardFunctions.EndOfYear(DateTime)
    StandardFunctions.EndOfDay(DateTime)
    StandardFunctions.Floor(decimal)
    StandardFunctions.Ceiling(decimal)
    StandardFunctions.BeginningOfYear(DateTime)
    StandardFunctions.BeginningOfDay(DateTime)
    StandardFunctions.Random(int, int)
    StandardFunctions.Trim(string)
    StandardFunctions.TrimStart(string, char[])
    StandardFunctions.TrimEnd(string, char[])
    StandardFunctions.PadLeft(string, int, char)
    StandardFunctions.PadRight(string, int, char)
    StandardFunctions.Mod(double, double)
    StandardFunctions.If(bool, object, object)
    StandardFunctions.IsIn(object, object)
    StandardFunctions.IsIn(object, object, object)
    StandardFunctions.IsIn(object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object)
    StandardFunctions.IsIn(object, object, object, object, object, object, object, object, object, object, object)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.SelectCase(object, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>, Func<Task<object>>)
    StandardFunctions.Format(object, string)
    StandardFunctions.Lower(string)
    StandardFunctions.Upper(string)
    StandardFunctions.WCase(string)
    StandardFunctions.Date(int, int, int)
    StandardFunctions.Year(DateTime)
    StandardFunctions.Month(DateTime)
    StandardFunctions.Day(DateTime)
    StandardFunctions.WeekDay(DateTime)
    StandardFunctions.Replace(string, string, string)
    StandardFunctions.Substr(string, int, int)
    StandardFunctions.Len(string)
    StandardFunctions.Abs(double)
    StandardFunctions.Int(object)
    StandardFunctions.Trunc(double, int)
    StandardFunctions.Dec(object)
    StandardFunctions.Round(object)
    StandardFunctions.IsBlank(string)
    StandardFunctions.Round(object, int)
    StandardFunctions.Min(double, double, double, double, double)
    StandardFunctions.Max(double, double, double, double, double)
    StandardFunctions.Chr(int)
    StandardFunctions.ChCR()
    StandardFunctions.ChLF()
    StandardFunctions.ChCRLF()
    StandardFunctions.Money(object)
    StandardFunctions.Contains(string, string)
    StandardFunctions.FormatDate(DateTime, string)
    StandardFunctions.Sqrt(double)
    StandardFunctions.Power(double, double)
    StandardFunctions.ValString(object)
    StandardFunctions.ValBool(object)
    StandardFunctions.ValDate(object)
    StandardFunctions.ValDateTimeOffset(object)
    StandardFunctions.ValDecimal(object)
    StandardFunctions.ValLong(object)
    StandardFunctions.ValID(object)
    StandardFunctions.DateAdd(DateTime, decimal, decimal, decimal)
    StandardFunctions.DateAdd(DateTimeOffset, decimal, decimal, decimal)
    StandardFunctions.DateAddWorkDays(DateTime, decimal)
    StandardFunctions.DateAdd(DateTime, DateTime)
    StandardFunctions.DayDifference(DateTime, DateTime)
    StandardFunctions.DayDifferenceWorkDays(DateTime, DateTime)
    StandardFunctions.HourDifference(DateTime, DateTime)
    StandardFunctions.MinuteDifference(DateTime, DateTime)
    StandardFunctions.YearDifference(DateTime, DateTime)
    StandardFunctions.NullDate()
    StandardFunctions.NullDateTimeOffset()
    StandardFunctions.TempValue1
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Client.Core
    Assembly: LemonEdge.ClientCore.dll
    Syntax
    public class FormulaFunctionsWithViewModel<T> : FormulaFunctionsWithContext<T>, IFormulaFunctionsWithViewModel<T>, IFormulaFunctionsWithViewModel, IFormulaFunctionsWithContext<T>, IFormulaFunctionsWithContext, IFormulaFunctions
    Type Parameters
    Name Description
    T The context supplied while executing a formula that has a custom context item, and a view that it operates against This context is mainly used against formulas that configure and work against a view itself, such as ones that can specify if a view is visible dynamically, or more.

    Constructors

    FormulaFunctionsWithViewModel(IEntityRetriever, IReadOnlyCache, UserInfo, T, IModelLayoutCommon, IFormulaFunctionsServiceContext)

    Declaration
    public FormulaFunctionsWithViewModel(IEntityRetriever retriever, IReadOnlyCache cache, UserInfo user, T item, IModelLayoutCommon host, IFormulaFunctionsServiceContext services)
    Parameters
    Type Name Description
    IEntityRetriever retriever
    IReadOnlyCache cache
    UserInfo user
    T item
    IModelLayoutCommon host
    IFormulaFunctionsServiceContext services

    Properties

    Host

    Declaration
    public IModelLayoutCommon Host { get; }
    Property Value
    Type Description
    IModelLayoutCommon

    IgnoreEvents

    Declaration
    public bool IgnoreEvents { get; set; }
    Property Value
    Type Description
    bool

    MyDataUI

    Declaration
    public IEntityUpdaterUI MyDataUI { get; }
    Property Value
    Type Description
    IEntityUpdaterUI

    RootController

    Declaration
    public IRootController RootController { get; }
    Property Value
    Type Description
    IRootController

    Methods

    CreateFormulaContext(Type)

    Declaration
    protected override FormulaFunctions CreateFormulaContext(Type ofType)
    Parameters
    Type Name Description
    Type ofType
    Returns
    Type Description
    FormulaFunctions
    Overrides
    FormulaFunctionsWithContext<T>.CreateFormulaContext(Type)

    DisplayError(Exception)

    Declaration
    [FormulaFunction(Name = "DisplayError", Type = "UI", Description = "Displays the specified exception to the user.", Params = "1. The exception to display.", ParamCount = 1, IsAsync = true)]
    public Task DisplayError(Exception ex)
    Parameters
    Type Name Description
    Exception ex
    Returns
    Type Description
    Task

    DisplayInformationMessage(string, string)

    Declaration
    [FormulaFunction(Name = "DisplayInformationMessage", Type = "UI", Description = "Displays ok message.", Params = "1. The title of the message.\r\n2. The message", ParamCount = 2, IsAsync = true)]
    public Task DisplayInformationMessage(string title, string msg)
    Parameters
    Type Name Description
    string title
    string msg
    Returns
    Type Description
    Task

    DisplayYesNoCancelQuestion(string, string)

    Declaration
    [FormulaFunction(Name = "DisplayYesNoCancelQuestion", Type = "UI", Description = "Displays a question to the user with a yes/no/cancel option. Returns null if cancel is selected, and true if yes is selected.", Params = "1. The title for the message box.\r\n2. The question the user is prompted with.", ParamCount = 2, IsAsync = true)]
    public Task<bool?> DisplayYesNoCancelQuestion(string title, string question)
    Parameters
    Type Name Description
    string title
    string question
    Returns
    Type Description
    Task<bool?>

    DisplayYesNoQuestion(string, string)

    Declaration
    [FormulaFunction(Name = "DisplayYesNoQuestion", Type = "UI", Description = "Displays a question to the user with a yes/no option. Returns true if yes is selected.", Params = "1. The title for the message box.\r\n2. The question the user is prompted with.", ParamCount = 2, IsAsync = true)]
    public Task<bool> DisplayYesNoQuestion(string title, string question)
    Parameters
    Type Name Description
    string title
    string question
    Returns
    Type Description
    Task<bool>

    OpenItem(IBaseEntity)

    Declaration
    [FormulaFunction(Name = "OpenItem", Type = "UI", Description = "Opens the specified item as a seperate tab in the app.", Params = "1. The item to open.", ParamCount = 1, IsAsync = true)]
    public Task OpenItem(IBaseEntity item)
    Parameters
    Type Name Description
    IBaseEntity item
    Returns
    Type Description
    Task

    OpenItemFromID(Type, Guid)

    Declaration
    [FormulaFunction(Name = "OpenItemFromID", Type = "UI", Description = "Opens the specified item as a seperate tab in the app.", Params = "1. The type of item to open.\r\n2. The id of the item to open", ParamCount = 2, IsAsync = true)]
    public Task OpenItemFromID(Type itemType, Guid itemID)
    Parameters
    Type Name Description
    Type itemType
    Guid itemID
    Returns
    Type Description
    Task

    SetBusy(string)

    Allow override in ui, but don't do anything in services

    Declaration
    [FormulaFunction(Name = "SetBusy", Type = "UI", Description = "Displays a busy spinner with the specified description.", Params = "1. The description to display while showing the busy spinner.", ParamCount = 1, IsAsync = false)]
    public override void SetBusy(string label)
    Parameters
    Type Name Description
    string label
    Overrides
    FormulaFunctionsWithContext<T>.SetBusy(string)

    StopBusy()

    Allow override in ui, but don't do anything in services

    Declaration
    [FormulaFunction(Name = "StopBusy", Type = "UI", Description = "Stops showing any previously displayed busy spinner.", Params = "", ParamCount = 0, IsAsync = false)]
    public override void StopBusy()
    Overrides
    FormulaFunctionsWithContext<T>.StopBusy()

    Implements

    IFormulaFunctionsWithViewModel<T>
    IFormulaFunctionsWithViewModel
    IFormulaFunctionsWithContext<T>
    IFormulaFunctionsWithContext
    IFormulaFunctions

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.