Repository navigation
DiGi.Scripting.Classes
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.ICloneableObjectInheritance 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
Initializes a new instance of the Code class by copying another Code instance.
public Code(DiGi.Scripting.Classes.Code? code);code Code
The source Code object to copy from.
Initializes a new instance of the Code class with the specified source code.
public Code(string? value);value System.String
The script source code.
Initializes a new instance of the Code class from a JSON object.
public Code(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing the code data.
Gets the script source code value.
public string? Value { get; }Implicitly converts a string to a Code instance.
public static DiGi.Scripting.Classes.Code? implicit operator DiGi.Scripting.Classes.Code?(string? value);value System.String
The string value to convert.
Code
A new Code instance wrapping the provided string.
Implicitly converts a Code instance to its underlying string value.
public static string? implicit operator string?(DiGi.Scripting.Classes.Code? code);code Code
The Code object to convert.
System.String
The source code string, or null if the object is null.
The exception that is thrown when script source code is missing.
public class CodeMissingException : System.ExceptionInheritance System.Object → System.Exception → CodeMissingException
Initializes a new instance of the CodeMissingException class.
public CodeMissingException();The exception that is thrown when an error occurs during the compilation of a script.
public class CompileException : System.ExceptionInheritance System.Object → System.Exception → CompileException
Initializes a new instance of the CompileException class with a specified error message.
public CompileException(string? message);message System.String
The message that describes the error.
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
Initializes a new instance of the Data class.
public Data();Initializes a new instance of the Data class using an existing dictionary.
public Data(System.Collections.Generic.IDictionary<string,object?>? dictionary);dictionary System.Collections.Generic.IDictionary<System.String,System.Object>
The source dictionary containing values to be copied into this instance.
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);keyValuePairs System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,dynamic>>
The collection of key-value pairs to initialize this instance with.
Gets a System.Collections.Generic.Dictionary<> representation of the current data.
public System.Collections.Generic.Dictionary<string,dynamic?> Dictionary { get; }System.Collections.Generic.Dictionary<System.String,dynamic>
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.IObjectInheritance System.Object → Variable → Input
Derived
↳ SerializableInput
Implements IInput, IVariable, IScriptingObject, DiGi.Core.Interfaces.IObject
Initializes a new instance of the Input class.
protected Input();Initializes a new instance of the Input class by copying another input variable.
public Input(DiGi.Scripting.Classes.Input? input);input Input
The source Input object to copy from.
Initializes a new instance of the Input class using a VariableType and a value.
public Input(DiGi.Scripting.Classes.VariableType? variableType, object? value);variableType VariableType
The VariableType defining the name and type of the variable.
value System.Object
The initial value of the input variable.
Initializes a new instance of the Input class with a specified name, type, and value.
public Input(string? name, System.Type? type, object? value);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.
Represents a script output variable.
public class Output : DiGi.Scripting.Classes.VariableInheritance System.Object → Variable → Output
Derived
↳ SerializableOutput
Initializes a new instance of the Output class.
protected Output();Initializes a new instance of the Output class by copying another output variable.
public Output(DiGi.Scripting.Classes.Output? output);output Output
The source output variable to copy.
Initializes a new instance of the Output class with specified variable type and value.
public Output(DiGi.Scripting.Classes.VariableType? variableType, object? value);variableType VariableType
The VariableType defining the name and type of the output variable.
value System.Object
The initial value of the output variable.
Initializes a new instance of the Output class with specified name, type, and value.
public Output(string? name, System.Type? type, object? value);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.
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.IObjectInheritance System.Object → Response
Implements IScriptingObject, DiGi.Core.Interfaces.IObject
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);outputs System.Collections.Generic.IEnumerable<Output>
The collection of Output variables produced by the script.
Initializes a new instance of the Response class with the specified exception.
public Response(System.Exception? exception);exception System.Exception
The exception that occurred during script execution, or null if none.
Gets the exception that occurred during script execution, if any.
public System.Exception? Exception { get; }Gets the collection of Output variables produced by the script.
public System.Collections.Generic.IEnumerable<DiGi.Scripting.Classes.Output>? Outputs { get; private set; }System.Collections.Generic.IEnumerable<Output>
Gets a value indicating whether the script execution succeeded without throwing an exception.
public bool Succeeded { get; }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.ICloneableObjectInheritance 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
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);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.
Initializes a new instance of the Script class by copying another script instance.
public Script(DiGi.Scripting.Classes.Script? script);script Script
The source Script to copy from.
Initializes a new instance of the Script class from a JSON object.
public Script(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the serialized script data.
Gets or sets the source code of the script wrapped in a Code object.
public DiGi.Scripting.Classes.Code? Code { get; set; }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; }System.Collections.Generic.IEnumerable<VariableType>
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; }System.Collections.Generic.IEnumerable<VariableType>
Executes the script using the provided input data.
public abstract DiGi.Scripting.Classes.Response? Execute(DiGi.Scripting.Classes.Data? inputData=null);inputData Data
The Data containing inputs for execution.
Response
A Response object containing the result of the execution or an exception.
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;TInput
A type that implements IInput.
inputs System.Collections.Generic.IEnumerable<TInput>
The collection of input variables.
Response
A Response object containing the result of the execution or an exception.
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.ICloneableObjectInheritance 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
Initializes a new instance of the SerializableInput class by copying another serializable input.
public SerializableInput(DiGi.Scripting.Classes.SerializableInput? serializableInput);serializableInput SerializableInput
The source serializable input to copy from.
Initializes a new instance of the SerializableInput class with a specified name and byte value.
public SerializableInput(string? name, byte value);name System.String
The name of the input variable.
value System.Byte
The byte value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of bytes.
public SerializableInput(string? name, byte[] value);name System.String
The name of the input variable.
value System.Byte[]
The byte array to assign.
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);name System.String
The name of the input variable.
value DiGi.Core.Interfaces.ISerializableObject
The DiGi.Core.Interfaces.ISerializableObject value to assign.
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);name System.String
The name of the input variable.
value DiGi.Core.Interfaces.ISerializableObject[]
The DiGi.Core.Interfaces.ISerializableObject array to assign.
Initializes a new instance of the SerializableInput class with a specified name and double value.
public SerializableInput(string? name, double value);name System.String
The name of the input variable.
value System.Double
The double value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of doubles.
public SerializableInput(string? name, double[] value);name System.String
The name of the input variable.
value System.Double[]
The double array to assign.
Initializes a new instance of the SerializableInput class with a specified name and integer value.
public SerializableInput(string? name, int value);name System.String
The name of the input variable.
value System.Int32
The integer value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of integers.
public SerializableInput(string? name, int[] value);name System.String
The name of the input variable.
value System.Int32[]
The integer array to assign.
Initializes a new instance of the SerializableInput class with a specified name and long value.
public SerializableInput(string? name, long value);name System.String
The name of the input variable.
value System.Int64
The long value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of longs.
public SerializableInput(string? name, long[] value);name System.String
The name of the input variable.
value System.Int64[]
The long array to assign.
Initializes a new instance of the SerializableInput class with a specified name and string value.
public SerializableInput(string? name, string value);name System.String
The name of the input variable.
value System.String
The string value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of strings.
public SerializableInput(string? name, string[] value);name System.String
The name of the input variable.
value System.String[]
The string array to assign.
Initializes a new instance of the SerializableInput class with a specified name and DateTime value.
public SerializableInput(string? name, System.DateTime value);name System.String
The name of the input variable.
value System.DateTime
The DateTime value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of DateTimes.
public SerializableInput(string? name, System.DateTime[] value);name System.String
The name of the input variable.
value System.DateTime[]
The DateTime array to assign.
Initializes a new instance of the SerializableInput class with a specified name and Guid value.
public SerializableInput(string? name, System.Guid value);name System.String
The name of the input variable.
value System.Guid
The Guid value to assign.
Initializes a new instance of the SerializableInput class with a specified name and array of Guids.
public SerializableInput(string? name, System.Guid[] value);name System.String
The name of the input variable.
value System.Guid[]
The Guid array to assign.
Initializes a new instance of the SerializableInput class from a JSON object.
public SerializableInput(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object containing the data.
Creates a deep copy of the serializable input.
public DiGi.Core.Interfaces.ISerializableObject? Clone();Implements Clone()
DiGi.Core.Interfaces.ISerializableObject
A clone of the current instance as an DiGi.Core.Interfaces.ISerializableObject.
Populates the properties of the serializable input from a JSON object.
public bool FromJsonObject(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to read data from.
Implements FromJsonObject(JsonObject)
System.Boolean
True if the operation was successful; otherwise, false.
Converts the serializable input to its JSON representation.
public System.Text.Json.Nodes.JsonObject? ToJsonObject();Implements ToJsonObject()
System.Text.Json.Nodes.JsonObject
A System.Text.Json.Nodes.JsonObject representing the current instance.
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.ICloneableObjectInheritance 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
Initializes a new instance of the SerializableOutput class by copying another serializable output.
public SerializableOutput(DiGi.Scripting.Classes.SerializableOutput? serializableOutput);serializableOutput SerializableOutput
The source SerializableOutput to copy from.
Initializes a new instance of the SerializableOutput class with a byte value.
public SerializableOutput(string? name, byte value);name System.String
The name of the output variable.
value System.Byte
The byte value to assign.
Initializes a new instance of the SerializableOutput class with an array of bytes.
public SerializableOutput(string? name, byte[] value);name System.String
The name of the output variable.
value System.Byte[]
The byte array value to assign.
Initializes a new instance of the SerializableOutput class with an DiGi.Core.Interfaces.ISerializableObject value.
public SerializableOutput(string? name, DiGi.Core.Interfaces.ISerializableObject value);name System.String
The name of the output variable.
value DiGi.Core.Interfaces.ISerializableObject
The serializable object value to assign.
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);name System.String
The name of the output variable.
value DiGi.Core.Interfaces.ISerializableObject[]
The serializable object array value to assign.
Initializes a new instance of the SerializableOutput class with a double value.
public SerializableOutput(string? name, double value);name System.String
The name of the output variable.
value System.Double
The double value to assign.
Initializes a new instance of the SerializableOutput class with an array of doubles.
public SerializableOutput(string? name, double[] value);name System.String
The name of the output variable.
value System.Double[]
The double array value to assign.
Initializes a new instance of the SerializableOutput class with an integer value.
public SerializableOutput(string? name, int value);name System.String
The name of the output variable.
value System.Int32
The integer value to assign.
Initializes a new instance of the SerializableOutput class with an array of integers.
public SerializableOutput(string? name, int[] value);name System.String
The name of the output variable.
value System.Int32[]
The integer array value to assign.
Initializes a new instance of the SerializableOutput class with a long value.
public SerializableOutput(string? name, long value);name System.String
The name of the output variable.
value System.Int64
The long value to assign.
Initializes a new instance of the SerializableOutput class with an array of longs.
public SerializableOutput(string? name, long[] value);name System.String
The name of the output variable.
value System.Int64[]
The long array value to assign.
Initializes a new instance of the SerializableOutput class with a string value.
public SerializableOutput(string? name, string value);name System.String
The name of the output variable.
value System.String
The string value to assign.
Initializes a new instance of the SerializableOutput class with an array of strings.
public SerializableOutput(string? name, string[] value);name System.String
The name of the output variable.
value System.String[]
The string array value to assign.
Initializes a new instance of the SerializableOutput class with a DateTime value.
public SerializableOutput(string? name, System.DateTime value);name System.String
The name of the output variable.
value System.DateTime
The System.DateTime value to assign.
Initializes a new instance of the SerializableOutput class with an array of DateTimes.
public SerializableOutput(string? name, System.DateTime[] value);name System.String
The name of the output variable.
value System.DateTime[]
The System.DateTime array value to assign.
Initializes a new instance of the SerializableOutput class with a GUID value.
public SerializableOutput(string? name, System.Guid value);name System.String
The name of the output variable.
value System.Guid
The System.Guid value to assign.
Initializes a new instance of the SerializableOutput class with an array of GUIDs.
public SerializableOutput(string? name, System.Guid[] value);name System.String
The name of the output variable.
value System.Guid[]
The System.Guid array value to assign.
Initializes a new instance of the SerializableOutput class from a JSON object.
public SerializableOutput(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject containing the data to populate the instance.
Creates a deep copy of the serializable output.
public DiGi.Core.Interfaces.ISerializableObject? Clone();Implements Clone()
DiGi.Core.Interfaces.ISerializableObject
A cloned instance as an DiGi.Core.Interfaces.ISerializableObject.
Populates the object's properties from a JSON object.
public bool FromJsonObject(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The System.Text.Json.Nodes.JsonObject to read data from.
Implements FromJsonObject(JsonObject)
System.Boolean
True if the operation was successful; otherwise, false.
Converts the object to a JSON representation.
public System.Text.Json.Nodes.JsonObject? ToJsonObject();Implements ToJsonObject()
System.Text.Json.Nodes.JsonObject
A System.Text.Json.Nodes.JsonObject representing this instance.
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.INamedObjectInheritance System.Object → Variable
Implements IScriptingObject, DiGi.Core.Interfaces.IObject, DiGi.Core.Interfaces.INamedObject
Initializes a new instance of the Variable class.
protected Variable();Initializes a new instance of the Variable class by copying another variable.
public Variable(DiGi.Scripting.Classes.Variable? variable);variable Variable
The source Variable to copy from.
Initializes a new instance of the Variable class with the specified type and value.
public Variable(DiGi.Scripting.Classes.VariableType? variableType, object? value);variableType VariableType
The VariableType defining the variable's metadata.
value System.Object
The initial value of the variable.
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);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.
Gets the name of the variable as defined in its VariableType.
public string? Name { get; }Implements Name
Gets the current value of the variable.
public object? Value { get; }Gets a clone of the VariableType associated with this variable.
public DiGi.Scripting.Classes.VariableType? VariableType { get; }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.ICloneableObjectInheritance 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
Initializes a new instance of the VariableType class by copying another variable type.
public VariableType(DiGi.Scripting.Classes.VariableType? variableType);variableType VariableType
The source VariableType to copy.
Initializes a new instance of the VariableType class.
public VariableType(string? name, System.Type? type);name System.String
The name of the variable.
type System.Type
The Type of the variable.
Initializes a new instance of the VariableType class from a System.Text.Json.Nodes.JsonObject.
public VariableType(System.Text.Json.Nodes.JsonObject? jsonObject);jsonObject System.Text.Json.Nodes.JsonObject
The JSON object to deserialize from.
Gets the name of the variable type.
public string? Name { get; }Implements Name
Gets the system Type associated with this variable type.
public System.Type? Type { get; }