Class Format
- Namespace
- BotManager.Runtime.Expressions
- Assembly
- BotManager.Runtime.dll
Formats a string by using Format(string, params object[]).
Return type is string.
"Hello World! 1 + 2 = 3":
{ "$Format": { "Text": "Hello {0}! {1} + {2} = {3}", "Parameters": [ "World", 1, 2, 3 ] } }
public sealed class Format : IExpression
- Inheritance
-
Format
- Implements
- Inherited Members
Constructors
Format()
Empty constructor for serialization.
public Format()
Format(IExpression, List)
Creates am expression that returns the result of Format(string, params object[]).
public Format(IExpression text, List parameters)
Parameters
textIExpressionThe format text.
parametersListThe list of parameters to insert.
Format(string, List)
Creates am expression that returns the result of Format(string, params object[]).
public Format(string text, List parameters)
Parameters
Properties
Parameters
Gets and sets the parameter list.
public List? Parameters { get; set; }
Property Value
Text
Gets and sets the format text.
public IExpression? Text { get; set; }
Property Value
Methods
ExecuteAsync(RuntimeContext, Type?)
Executes the expression in the given RuntimeContext. Please do not use this method to run an expression. Use ExecuteAsync(IExpression?) instead.
public Task<object?> ExecuteAsync(RuntimeContext context, Type? returnType)
Parameters
contextRuntimeContextThe current runtime context.
returnTypeTypeThe expected return type. Use
typeof(object)for a generic result. Usenullif you don't need the return value.