Devesprit.Scripter

ScriptType Enumeration

Different types of scripts executable by ScriptEngine.

Namespace:  Devesprit.Scripter
Assembly:  Devesprit Scripter (in Devesprit Scripter.dll)

Syntax


public enum ScriptType
Public Enumeration ScriptType
public enum class ScriptType

Members


Member nameDescription
CSharpProgram The script must be written in C# language and in the form of a program. A static method named Main must be included in this kind of script.

Examples


C#
Result Main(int a)
{
    var date = DateTime.Now;
    MessageBox.Show(date.ToString());
    return new Result()
        {
            DateNow = date.ToString(),
            Pow = a * a
        };
}

[Serializable]
public class Result
{
    public string DateNow;
    public int Pow;
}
CSharpStatement The script must be written in C# language and in the form of a Statement.

Examples


C#
var date = DateTime.Now;
MessageBox.Show(date.ToString());
int pow = 10 * 10;
CSharpExpression The script must be written in C# language and in the form of an Expression.

Examples


C#
DateTime.Now.Second
VBProgram The script must be written in VB.Net language and in the form of a Program. A static method named Main must be included in this kind of script.

Examples


VB.NET
Private Function Main(a As Integer) As Result
    Dim [date] = DateTime.Now
    MessageBox.Show([date].ToString())
    Return New Result() With {
        Key .DateNow = [date].ToString(),
        Key .Pow = a * a
    }
End Function

<Serializable>
Public Class Result
    Public DateNow As String
    Public Pow As Integer
End Class
VBStatement The script must be written in VB.Net language and in the form of a Statement.

Examples


VB.NET
Dim [date] = DateTime.Now
MessageBox.Show([date].ToString())
Dim pow As Integer = 10 * 10
VBExpression The script must be written in VB.Net language and in the form of an Expression.

Examples


VB.NET
DateTime.Now.Second
FSharpProgram The script must be written in F# language and in the form of a Program. A static method named Main must be included in this kind of script.

Examples


F#
let square x = x * x

let main = square 12
FSharpExpression The script must be written in F# language and in the form of an Expression.

Examples


F#
10 * 20
JScriptProgram The script must be written in JScript.Net language and in the form of a Program. A static method named Main must be included in this kind of script.

Examples


JScript.NET
public function main() : String
{
        var date = DateTime.Now;
        MessageBox.Show(date.ToString());
        return date.ToString();
}
JScriptStatement The script must be written in JScript.Net language and in the form of a Statement.

Examples


JScript.NET
var date = DateTime.Now;
MessageBox.Show(date.ToString());
int pow = 10 * 10;
JScriptExpression The script must be written in JScript.Net language and in the form of an Expression.

Examples


JScript.NET
DateTime.Now.Second