Files
Convention-CSharp/[Test]/Program.cs

39 lines
821 B
C#
Raw Normal View History

2025-10-17 15:47:20 +08:00
using Convention;
using Convention.EasySave;
using Convention.RScript;
2025-10-27 10:51:17 +08:00
using Convention.RScript.Variable;
using Convention.RScript.Variable.Attr;
using Convention.RScript.Variable.CStyle;
using System;
2025-10-17 15:47:20 +08:00
using System.IO;
2025-06-13 10:52:21 +08:00
public class Program
{
2025-10-27 10:51:17 +08:00
[Description(@"
1
")]
[Default(@"
this.Log(1);
")]
public class Test
2025-10-16 11:29:50 +08:00
{
2025-10-27 10:51:17 +08:00
[Method]
public void Log(object o)
2025-10-16 11:29:50 +08:00
{
2025-10-27 10:51:17 +08:00
Console.WriteLine(o);
2025-10-16 11:29:50 +08:00
}
}
2025-06-13 10:52:21 +08:00
static void Main(string[] args)
{
2025-10-27 10:51:17 +08:00
var engine = new RScriptEngine();
var testClass = new CScriptRScriptVariableGenerater(typeof(Test), () => new Test(), null, nameof(Test));
testClass.Register();
engine.Run(@"
var t = New(Test);
t.Log(114514);
");
Console.WriteLine(testClass.scriptIndicator);
2025-06-13 10:52:21 +08:00
}
}