Skip to content

DiGi.Scripting.Classes

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.Scripting.Classes Namespace

Classes

Code Class

Wraps script source code as a serializable string value.

public sealed class Code : DiGi.Core.Classes.SerializableObject, DiGi.Scripting.Interfaces.IScriptingSerializableObject, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Code

Implements IScriptingSerializableObject, IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Constructors

Code(Code) Constructor

Initializes a new instance of the Code class by copying another Code instance.

public Code(DiGi.Scripting.Classes.Code? code);

Parameters

code Code

The source Code object to copy from.

Code(string) Constructor

Initializes a new instance of the Code class with the specified source code.

public Code(string? value);

Parameters

value System.String

The script source code.

Code(JsonObject) Constructor

Initializes a new instance of the Code class from a JSON object.

public Code(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the code data.

Properties

Code.Value Property

Gets the script source code value.

public string? Value { get; }

Property Value

System.String

Operators

Code.implicit operator Code(string) Operator

Implicitly converts a string to a Code instance.

public static DiGi.Scripting.Classes.Code? implicit operator DiGi.Scripting.Classes.Code?(string? value);

Parameters

value System.String

The string value to convert.

Returns

Code
A new Code instance wrapping the provided string.

Code.implicit operator string(Code) Operator

Implicitly converts a Code instance to its underlying string value.

public static string? implicit operator string?(DiGi.Scripting.Classes.Code? code);

Parameters

code Code

The Code object to convert.

Returns

System.String
The source code string, or null if the object is null.

CodeMissingException Class

The exception that is thrown when script source code is missing.

public class CodeMissingException : System.Exception

Inheritance System.Object → System.Exception → CodeMissingException

Constructors

CodeMissingException() Constructor

Initializes a new instance of the CodeMissingException class.

public CodeMissingException();

CompileException Class

The exception that is thrown when an error occurs during the compilation of a script.

public class CompileException : System.Exception

Inheritance System.Object → System.Exception → CompileException

Constructors

CompileException(string) Constructor

Initializes a new instance of the CompileException class with a specified error message.

public CompileException(string? message);

Parameters

message System.String

The message that describes the error.

Data Class

A key/value store for script execution data, extending System.Collections.Generic.Dictionary<>.

public class Data : System.Collections.Generic.Dictionary<string, dynamic?>

Inheritance System.Object → System.Collections.Generic.Dictionary<System.String,dynamic> → Data

Constructors

Data() Constructor

Initializes a new instance of the Data class.

public Data();

Data(IDictionary<string,object>) Constructor

Initializes a new instance of the Data class using an existing dictionary.

public Data(System.Collections.Generic.IDictionary<string,object?>? dictionary);

Parameters

dictionary System.Collections.Generic.IDictionary<System.String,System.Object>

The source dictionary containing values to be copied into this instance.

Data(IEnumerable<KeyValuePair<string,dynamic>>) Constructor

Initializes a new instance of the Data class using a collection of key-value pairs.

public Data(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,dynamic?>>? keyValuePairs);

Parameters

keyValuePairs System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,dynamic>>

The collection of key-value pairs to initialize this instance with.

Properties

Data.Dictionary Property

Gets a System.Collections.Generic.Dictionary<> representation of the current data.

public System.Collections.Generic.Dictionary<string,dynamic?> Dictionary { get; }

Property Value

System.Collections.Generic.Dictionary<System.String,dynamic>

Input Class

Represents a script input variable, extending the base Variable class and implementing IInput.

public class Input : DiGi.Scripting.Classes.Variable, DiGi.Scripting.Interfaces.IInput, DiGi.Scripting.Interfaces.IVariable, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject

Inheritance System.Object → Variable → Input

Derived
↳ SerializableInput

Implements IInput, IVariable, IScriptingObject, DiGi.Core.Interfaces.IObject

Constructors

Input() Constructor

Initializes a new instance of the Input class.

protected Input();

Input(Input) Constructor

Initializes a new instance of the Input class by copying another input variable.

public Input(DiGi.Scripting.Classes.Input? input);

Parameters

input Input

The source Input object to copy from.

Input(VariableType, object) Constructor

Initializes a new instance of the Input class using a VariableType and a value.

public Input(DiGi.Scripting.Classes.VariableType? variableType, object? value);

Parameters

variableType VariableType

The VariableType defining the name and type of the variable.

value System.Object

The initial value of the input variable.

Input(string, Type, object) Constructor

Initializes a new instance of the Input class with a specified name, type, and value.

public Input(string? name, System.Type? type, object? value);

Parameters

name System.String

The name of the input variable.

type System.Type

The System.Type of the input variable.

value System.Object

The initial value of the input variable.

Output Class

Represents a script output variable.

public class Output : DiGi.Scripting.Classes.Variable

Inheritance System.Object → Variable → Output

Derived
↳ SerializableOutput

Constructors

Output() Constructor

Initializes a new instance of the Output class.

protected Output();

Output(Output) Constructor

Initializes a new instance of the Output class by copying another output variable.

public Output(DiGi.Scripting.Classes.Output? output);

Parameters

output Output

The source output variable to copy.

Output(VariableType, object) Constructor

Initializes a new instance of the Output class with specified variable type and value.

public Output(DiGi.Scripting.Classes.VariableType? variableType, object? value);

Parameters

variableType VariableType

The VariableType defining the name and type of the output variable.

value System.Object

The initial value of the output variable.

Output(string, Type, object) Constructor

Initializes a new instance of the Output class with specified name, type, and value.

public Output(string? name, System.Type? type, object? value);

Parameters

name System.String

The name of the output variable.

type System.Type

The data type of the output variable.

value System.Object

The initial value of the output variable.

Response Class

Represents the result of a script execution, containing either the produced Output variables or an exception if the execution failed.

public class Response : DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject

Inheritance System.Object → Response

Implements IScriptingObject, DiGi.Core.Interfaces.IObject

Constructors

Response(IEnumerable<Output>) Constructor

Initializes a new instance of the Response class with the specified collection of outputs.

public Response(System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.Output>? outputs);

Parameters

outputs System.Collections.Generic.IEnumerable<Output>

The collection of Output variables produced by the script.

Response(Exception) Constructor

Initializes a new instance of the Response class with the specified exception.

public Response(System.Exception? exception);

Parameters

exception System.Exception

The exception that occurred during script execution, or null if none.

Properties

Response.Exception Property

Gets the exception that occurred during script execution, if any.

public System.Exception? Exception { get; }

Property Value

System.Exception

Response.Outputs Property

Gets the collection of Output variables produced by the script.

public System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.Output>? Outputs { get; private set; }

Property Value

System.Collections.Generic.IEnumerable<Output>

Response.Succeeded Property

Gets a value indicating whether the script execution succeeded without throwing an exception.

public bool Succeeded { get; }

Property Value

System.Boolean

Script Class

Abstract base class for language-specific script runners, implementing IScript.

public abstract class Script : DiGi.Core.Classes.SerializableObject, DiGi.Scripting.Interfaces.IScript, DiGi.Scripting.Interfaces.IScriptingSerializableObject, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → Script

Implements IScript, IScriptingSerializableObject, IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Constructors

Script(Code, IEnumerable<VariableType>, IEnumerable<VariableType>) Constructor

Initializes a new instance of the Script class with specified source code and variable type definitions.

public Script(DiGi.Scripting.Classes.Code? code, System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.VariableType>? inputVariableTypes, System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.VariableType>? outputVariableTypes);

Parameters

code Code

The Code containing the script source.

inputVariableTypes System.Collections.Generic.IEnumerable<VariableType>

A collection of VariableType defining the expected inputs.

outputVariableTypes System.Collections.Generic.IEnumerable<VariableType>

A collection of VariableType defining the expected outputs.

Script(Script) Constructor

Initializes a new instance of the Script class by copying another script instance.

public Script(DiGi.Scripting.Classes.Script? script);

Parameters

script Script

The source Script to copy from.

Script(JsonObject) Constructor

Initializes a new instance of the Script class from a JSON object.

public Script(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the serialized script data.

Properties

Script.Code Property

Gets or sets the source code of the script wrapped in a Code object.

public DiGi.Scripting.Classes.Code? Code { get; set; }

Property Value

Code

Script.InputVariableTypes Property

Gets or sets the collection of VariableType defining the input variables for the script.

public System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.VariableType>? InputVariableTypes { get; set; }

Property Value

System.Collections.Generic.IEnumerable<VariableType>

Script.OutputVariableTypes Property

Gets or sets the collection of VariableType defining the output variables for the script.

public System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.VariableType>? OutputVariableTypes { get; set; }

Property Value

System.Collections.Generic.IEnumerable<VariableType>

Methods

Script.Execute(Data) Method

Executes the script using the provided input data.

public abstract DiGi.Scripting.Classes.Response? Execute(DiGi.Scripting.Classes.Data? inputData=null);

Parameters

inputData Data

The Data containing inputs for execution.

Returns

Response
A Response object containing the result of the execution or an exception.

Script.Execute<TInput>(IEnumerable<TInput>) Method

Executes the script using a collection of IInput objects as inputs.

public DiGi.Scripting.Classes.Response? Execute<TInput>(System.Collections.Generic.IEnumerable<TInput>? inputs=null)
    where TInput : DiGi.Scripting.Interfaces.IInput;

Type parameters

TInput

A type that implements IInput.

Parameters

inputs System.Collections.Generic.IEnumerable<TInput>

The collection of input variables.

Returns

Response
A Response object containing the result of the execution or an exception.

SerializableInput Class

Represents a script input variable that can be serialized and deserialized.

public class SerializableInput : DiGi.Scripting.Classes.Input, DiGi.Scripting.Interfaces.ISerializableInput, DiGi.Scripting.Interfaces.IInput, DiGi.Scripting.Interfaces.IVariable, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Inheritance System.Object → Variable → Input → SerializableInput

Implements ISerializableInput, IInput, IVariable, IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Constructors

SerializableInput(SerializableInput) Constructor

Initializes a new instance of the SerializableInput class by copying another serializable input.

public SerializableInput(DiGi.Scripting.Classes.SerializableInput? serializableInput);

Parameters

serializableInput SerializableInput

The source serializable input to copy from.

SerializableInput(string, byte) Constructor

Initializes a new instance of the SerializableInput class with a specified name and byte value.

public SerializableInput(string? name, byte value);

Parameters

name System.String

The name of the input variable.

value System.Byte

The byte value to assign.

SerializableInput(string, byte[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of bytes.

public SerializableInput(string? name, byte[] value);

Parameters

name System.String

The name of the input variable.

value System.Byte[]

The byte array to assign.

SerializableInput(string, ISerializableObject) Constructor

Initializes a new instance of the SerializableInput class with a specified name and serializable object value.

public SerializableInput(string? name, DiGi.Core.Interfaces.ISerializableObject value);

Parameters

name System.String

The name of the input variable.

value DiGi.Core.Interfaces.ISerializableObject

The DiGi.Core.Interfaces.ISerializableObject value to assign.

SerializableInput(string, ISerializableObject[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of serializable objects.

public SerializableInput(string? name, DiGi.Core.Interfaces.ISerializableObject[] value);

Parameters

name System.String

The name of the input variable.

value DiGi.Core.Interfaces.ISerializableObject[]

The DiGi.Core.Interfaces.ISerializableObject array to assign.

SerializableInput(string, double) Constructor

Initializes a new instance of the SerializableInput class with a specified name and double value.

public SerializableInput(string? name, double value);

Parameters

name System.String

The name of the input variable.

value System.Double

The double value to assign.

SerializableInput(string, double[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of doubles.

public SerializableInput(string? name, double[] value);

Parameters

name System.String

The name of the input variable.

value System.Double[]

The double array to assign.

SerializableInput(string, int) Constructor

Initializes a new instance of the SerializableInput class with a specified name and integer value.

public SerializableInput(string? name, int value);

Parameters

name System.String

The name of the input variable.

value System.Int32

The integer value to assign.

SerializableInput(string, int[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of integers.

public SerializableInput(string? name, int[] value);

Parameters

name System.String

The name of the input variable.

value System.Int32[]

The integer array to assign.

SerializableInput(string, long) Constructor

Initializes a new instance of the SerializableInput class with a specified name and long value.

public SerializableInput(string? name, long value);

Parameters

name System.String

The name of the input variable.

value System.Int64

The long value to assign.

SerializableInput(string, long[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of longs.

public SerializableInput(string? name, long[] value);

Parameters

name System.String

The name of the input variable.

value System.Int64[]

The long array to assign.

SerializableInput(string, string) Constructor

Initializes a new instance of the SerializableInput class with a specified name and string value.

public SerializableInput(string? name, string value);

Parameters

name System.String

The name of the input variable.

value System.String

The string value to assign.

SerializableInput(string, string[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of strings.

public SerializableInput(string? name, string[] value);

Parameters

name System.String

The name of the input variable.

value System.String[]

The string array to assign.

SerializableInput(string, DateTime) Constructor

Initializes a new instance of the SerializableInput class with a specified name and DateTime value.

public SerializableInput(string? name, System.DateTime value);

Parameters

name System.String

The name of the input variable.

value System.DateTime

The DateTime value to assign.

SerializableInput(string, DateTime[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of DateTimes.

public SerializableInput(string? name, System.DateTime[] value);

Parameters

name System.String

The name of the input variable.

value System.DateTime[]

The DateTime array to assign.

SerializableInput(string, Guid) Constructor

Initializes a new instance of the SerializableInput class with a specified name and Guid value.

public SerializableInput(string? name, System.Guid value);

Parameters

name System.String

The name of the input variable.

value System.Guid

The Guid value to assign.

SerializableInput(string, Guid[]) Constructor

Initializes a new instance of the SerializableInput class with a specified name and array of Guids.

public SerializableInput(string? name, System.Guid[] value);

Parameters

name System.String

The name of the input variable.

value System.Guid[]

The Guid array to assign.

SerializableInput(JsonObject) Constructor

Initializes a new instance of the SerializableInput class from a JSON object.

public SerializableInput(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object containing the data.

Methods

SerializableInput.Clone() Method

Creates a deep copy of the serializable input.

public DiGi.Core.Interfaces.ISerializableObject? Clone();

Implements Clone()

Returns

DiGi.Core.Interfaces.ISerializableObject
A clone of the current instance as an DiGi.Core.Interfaces.ISerializableObject.

SerializableInput.FromJsonObject(JsonObject) Method

Populates the properties of the serializable input from a JSON object.

public bool FromJsonObject(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object to read data from.

Implements FromJsonObject(JsonObject)

Returns

System.Boolean
True if the operation was successful; otherwise, false.

SerializableInput.ToJsonObject() Method

Converts the serializable input to its JSON representation.

public System.Text.Json.Nodes.JsonObject? ToJsonObject();

Implements ToJsonObject()

Returns

System.Text.Json.Nodes.JsonObject
A System.Text.Json.Nodes.JsonObject representing the current instance.

SerializableOutput Class

Represents a serializable script output variable that implements ISerializableOutput.

public class SerializableOutput : DiGi.Scripting.Classes.Output, DiGi.Scripting.Interfaces.ISerializableOutput, DiGi.Scripting.Interfaces.IOutput, DiGi.Scripting.Interfaces.IVariable, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Inheritance System.Object → Variable → Output → SerializableOutput

Implements ISerializableOutput, IOutput, IVariable, IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Constructors

SerializableOutput(SerializableOutput) Constructor

Initializes a new instance of the SerializableOutput class by copying another serializable output.

public SerializableOutput(DiGi.Scripting.Classes.SerializableOutput? serializableOutput);

Parameters

serializableOutput SerializableOutput

The source SerializableOutput to copy from.

SerializableOutput(string, byte) Constructor

Initializes a new instance of the SerializableOutput class with a byte value.

public SerializableOutput(string? name, byte value);

Parameters

name System.String

The name of the output variable.

value System.Byte

The byte value to assign.

SerializableOutput(string, byte[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of bytes.

public SerializableOutput(string? name, byte[] value);

Parameters

name System.String

The name of the output variable.

value System.Byte[]

The byte array value to assign.

SerializableOutput(string, ISerializableObject) Constructor

Initializes a new instance of the SerializableOutput class with an DiGi.Core.Interfaces.ISerializableObject value.

public SerializableOutput(string? name, DiGi.Core.Interfaces.ISerializableObject value);

Parameters

name System.String

The name of the output variable.

value DiGi.Core.Interfaces.ISerializableObject

The serializable object value to assign.

SerializableOutput(string, ISerializableObject[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of DiGi.Core.Interfaces.ISerializableObject.

public SerializableOutput(string? name, DiGi.Core.Interfaces.ISerializableObject[] value);

Parameters

name System.String

The name of the output variable.

value DiGi.Core.Interfaces.ISerializableObject[]

The serializable object array value to assign.

SerializableOutput(string, double) Constructor

Initializes a new instance of the SerializableOutput class with a double value.

public SerializableOutput(string? name, double value);

Parameters

name System.String

The name of the output variable.

value System.Double

The double value to assign.

SerializableOutput(string, double[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of doubles.

public SerializableOutput(string? name, double[] value);

Parameters

name System.String

The name of the output variable.

value System.Double[]

The double array value to assign.

SerializableOutput(string, int) Constructor

Initializes a new instance of the SerializableOutput class with an integer value.

public SerializableOutput(string? name, int value);

Parameters

name System.String

The name of the output variable.

value System.Int32

The integer value to assign.

SerializableOutput(string, int[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of integers.

public SerializableOutput(string? name, int[] value);

Parameters

name System.String

The name of the output variable.

value System.Int32[]

The integer array value to assign.

SerializableOutput(string, long) Constructor

Initializes a new instance of the SerializableOutput class with a long value.

public SerializableOutput(string? name, long value);

Parameters

name System.String

The name of the output variable.

value System.Int64

The long value to assign.

SerializableOutput(string, long[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of longs.

public SerializableOutput(string? name, long[] value);

Parameters

name System.String

The name of the output variable.

value System.Int64[]

The long array value to assign.

SerializableOutput(string, string) Constructor

Initializes a new instance of the SerializableOutput class with a string value.

public SerializableOutput(string? name, string value);

Parameters

name System.String

The name of the output variable.

value System.String

The string value to assign.

SerializableOutput(string, string[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of strings.

public SerializableOutput(string? name, string[] value);

Parameters

name System.String

The name of the output variable.

value System.String[]

The string array value to assign.

SerializableOutput(string, DateTime) Constructor

Initializes a new instance of the SerializableOutput class with a DateTime value.

public SerializableOutput(string? name, System.DateTime value);

Parameters

name System.String

The name of the output variable.

value System.DateTime

The System.DateTime value to assign.

SerializableOutput(string, DateTime[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of DateTimes.

public SerializableOutput(string? name, System.DateTime[] value);

Parameters

name System.String

The name of the output variable.

value System.DateTime[]

The System.DateTime array value to assign.

SerializableOutput(string, Guid) Constructor

Initializes a new instance of the SerializableOutput class with a GUID value.

public SerializableOutput(string? name, System.Guid value);

Parameters

name System.String

The name of the output variable.

value System.Guid

The System.Guid value to assign.

SerializableOutput(string, Guid[]) Constructor

Initializes a new instance of the SerializableOutput class with an array of GUIDs.

public SerializableOutput(string? name, System.Guid[] value);

Parameters

name System.String

The name of the output variable.

value System.Guid[]

The System.Guid array value to assign.

SerializableOutput(JsonObject) Constructor

Initializes a new instance of the SerializableOutput class from a JSON object.

public SerializableOutput(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject containing the data to populate the instance.

Methods

SerializableOutput.Clone() Method

Creates a deep copy of the serializable output.

public DiGi.Core.Interfaces.ISerializableObject? Clone();

Implements Clone()

Returns

DiGi.Core.Interfaces.ISerializableObject
A cloned instance as an DiGi.Core.Interfaces.ISerializableObject.

SerializableOutput.FromJsonObject(JsonObject) Method

Populates the object's properties from a JSON object.

public bool FromJsonObject(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The System.Text.Json.Nodes.JsonObject to read data from.

Implements FromJsonObject(JsonObject)

Returns

System.Boolean
True if the operation was successful; otherwise, false.

SerializableOutput.ToJsonObject() Method

Converts the object to a JSON representation.

public System.Text.Json.Nodes.JsonObject? ToJsonObject();

Implements ToJsonObject()

Returns

System.Text.Json.Nodes.JsonObject
A System.Text.Json.Nodes.JsonObject representing this instance.

Variable Class

Abstract base class for script variables, providing a link between a VariableType and its current value.

public abstract class Variable : DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.INamedObject

Inheritance System.Object → Variable

Derived
↳ Input
↳ Output

Implements IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.INamedObject

Constructors

Variable() Constructor

Initializes a new instance of the Variable class.

protected Variable();

Variable(Variable) Constructor

Initializes a new instance of the Variable class by copying another variable.

public Variable(DiGi.Scripting.Classes.Variable? variable);

Parameters

variable Variable

The source Variable to copy from.

Variable(VariableType, object) Constructor

Initializes a new instance of the Variable class with the specified type and value.

public Variable(DiGi.Scripting.Classes.VariableType? variableType, object? value);

Parameters

variableType VariableType

The VariableType defining the variable's metadata.

value System.Object

The initial value of the variable.

Variable(string, Type, object) Constructor

Initializes a new instance of the Variable class by creating a VariableType from the provided name and type.

public Variable(string? name, System.Type? type, object? value);

Parameters

name System.String

The name of the variable.

type System.Type

The system System.Type of the variable.

value System.Object

The initial value of the variable.

Properties

Variable.Name Property

Gets the name of the variable as defined in its VariableType.

public string? Name { get; }

Implements Name

Property Value

System.String

Variable.Value Property

Gets the current value of the variable.

public object? Value { get; }

Property Value

System.Object

Variable.VariableType Property

Gets a clone of the VariableType associated with this variable.

public DiGi.Scripting.Classes.VariableType? VariableType { get; }

Property Value

VariableType

VariableType Class

Describes a named, typed script variable.

public class VariableType : DiGi.Core.Classes.SerializableObject, DiGi.Core.Interfaces.INamedObject, DiGi.Core.Interfaces.IObject, DiGi.Scripting.Interfaces.IScriptingSerializableObject, DiGi.Scripting.Interfaces.IScriptingObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Inheritance System.Object → DiGi.Core.Classes.Object → DiGi.Core.Classes.SerializableObject → VariableType

Implements DiGi.Core.Interfaces.INamedObject, DiGi.Core.Interfaces.IObject, IScriptingSerializableObject, IScriptingObject, DiGi.Core.Interfaces.ISerializableObject, DiGi.Core.Interfaces.ICloneableObject<DiGi.Core.Interfaces.ISerializableObject>, DiGi.Core.Interfaces.ICloneableObject

Constructors

VariableType(VariableType) Constructor

Initializes a new instance of the VariableType class by copying another variable type.

public VariableType(DiGi.Scripting.Classes.VariableType? variableType);

Parameters

variableType VariableType

The source VariableType to copy.

VariableType(string, Type) Constructor

Initializes a new instance of the VariableType class.

public VariableType(string? name, System.Type? type);

Parameters

name System.String

The name of the variable.

type System.Type

The Type of the variable.

VariableType(JsonObject) Constructor

Initializes a new instance of the VariableType class from a System.Text.Json.Nodes.JsonObject.

public VariableType(System.Text.Json.Nodes.JsonObject? jsonObject);

Parameters

jsonObject System.Text.Json.Nodes.JsonObject

The JSON object to deserialize from.

Properties

VariableType.Name Property

Gets the name of the variable type.

public string? Name { get; }

Implements Name

Property Value

System.String

VariableType.Type Property

Gets the system Type associated with this variable type.

public System.Type? Type { get; }

Property Value

System.Type

Clone this wiki locally