Class VariableRequest
Internal storage class for variable requests
Inherited Members
Namespace: DuetControlServer.SPI
Assembly: DuetControlServer.dll
Syntax
public class VariableRequest
Constructors
VariableRequest(CodeChannel, bool, string, string?)
Constructor of this class
Declaration
public VariableRequest(CodeChannel channel, bool createVariable, string varName, string? expression)
Parameters
Type | Name | Description |
---|---|---|
CodeChannel | channel | Where to evaluate the expression |
bool | createVariable | Whether the variable is supposed to be created |
string | varName | Name of the variable |
string | expression | Expression to evaluate |
Properties
Channel
Where the expression is evaluated
Declaration
public CodeChannel Channel { get; }
Property Value
Type | Description |
---|---|
CodeChannel |
CreateVariable
Whether the variable is supposed to be created
Declaration
public bool CreateVariable { get; }
Property Value
Type | Description |
---|---|
bool |
Expression
Expression to set or null if the variable is supposed to be deleted
Declaration
public string? Expression { get; }
Property Value
Type | Description |
---|---|
string |
Task
Task that completes when the request has been fulfilled
Declaration
public Task<object?> Task { get; }
Property Value
Type | Description |
---|---|
Task<object> |
VariableName
Name of the variable
Declaration
public string VariableName { get; }
Property Value
Type | Description |
---|---|
string |
Written
Whether the request has been sent to the firmware
Declaration
public bool Written { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
SetCanceled()
Set the task to canceled
Declaration
public void SetCanceled()
SetException(Exception)
Set an exception for the task
Declaration
public void SetException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | Exception to set |
SetResult(object?)
Set the result of the evaluated expression
Declaration
public void SetResult(object? result)
Parameters
Type | Name | Description |
---|---|---|
object | result | Result to set |