Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            scriptService = new CSLE.CLS_Environment(this); //初始化CLScript
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallAdd));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallDec));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call2)testCallAdd4));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(UserData)));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Country)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Vector3)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <CLScriptExt.Student>), "List<Student>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <CLScriptExt.Vector3>), "List<Vector3>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <int>), "List<int>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(int[]), "int[]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(string[]), "string[]"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Dictionary <string, string>), "Dictionary<string,string>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student.S1), "Student.S1"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(DateTime)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(TimeSpan)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Form1)));

            scriptService.RegType(new CSLE.RegHelper_DeleAction <int>(typeof(Action <int>), "Action<int>"));
            //CLScriptExt.Type_Vector3());
            InitCodeFile();
            ScriptNET.Runtime.RuntimeHost.Initialize();
        }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {


            scriptService = new CSLE.CLS_Environment(this); //初始化CLScript
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallAdd));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallDec));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call2)testCallAdd4));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(UserData)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Math)));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Country)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Vector3)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.P1)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Color32)));


            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(CLScriptExt.Student.StudentAss), "Student.StudentAss"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson), "MyJson"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson.JsonNode_ValueNumber), "MyJson.JsonNode_ValueNumber"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson.IJsonNode), "MyJson.IJsonNode"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson.JsonNode_ValueString), "MyJson.JsonNode_ValueString"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson.JsonNode_Object), "MyJson.JsonNode_Object"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(MyJson.JsonNode_Array), "MyJson.JsonNode_Array"));

            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(List<>), "List"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(Dictionary<,>), "Dictionary"));

            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(List<CLScriptExt.Student>), "List<Student>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(List<CLScriptExt.Vector3>), "List<Vector3>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(List<int>), "List<int>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(List<List<int>>), "List<List<int>>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(int[]), "int[]"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(char[]), "char[]"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(int[][]), "int[][]"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(string[]), "string[]"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(object), "object"));

            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(CLScriptExt.MyClass2), "MyClass2"));

            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(Dictionary<string, string>), "Dictionary<string,string>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(CLScriptExt.Student.S1), "Student.S1"));

            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(DateTime), "DateTime"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(TimeSpan), "TimeSpan"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(Form1), "Form1"));


            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(Action<int>), "Action<int>"));
            scriptService.RegType(CSLE.RegHelper_Type.MakeType(typeof(EventHandler), "EventHandler"));

            //CLScriptExt.Type_Vector3());
            InitCodeFile();
            ScriptNET.Runtime.RuntimeHost.Initialize();

        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            scriptService = new CSLE.CLS_Environment(this); //初始化CLScript
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallAdd));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallDec));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call2)testCallAdd4));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(UserData)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Math)));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Country)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Vector3)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.P1)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Color32)));
            //scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.P2)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student.StudentAss), "Student.StudentAss"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson), "MyJson"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_ValueNumber), "MyJson.JsonNode_ValueNumber"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.IJsonNode), "MyJson.IJsonNode"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_ValueString), "MyJson.JsonNode_ValueString"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_Object), "MyJson.JsonNode_Object"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_Array), "MyJson.JsonNode_Array"));
            Type t = Type.GetType("System.Collections.Generic.List`1");

            scriptService.RegType(new CSLE.RegHelper_Type(t, "List"));

            Type t2 = Type.GetType("System.Collections.Generic.Dictionary`2");

            scriptService.RegType(new CSLE.RegHelper_Type(t2, "Dictionary"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <CLScriptExt.Student>), "List<Student>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <CLScriptExt.Vector3>), "List<Vector3>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <int>), "List<int>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List <List <int> >), "List<List<int>>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(int[]), "int[]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(char[]), "char[]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(int[][]), "int[][]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(string[]), "string[]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(object), "object"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.MyClass2), "MyClass2"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Dictionary <string, string>), "Dictionary<string,string>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student.S1), "Student.S1"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(DateTime)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(TimeSpan)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Form1)));


            scriptService.RegType(new CSLE.RegHelper_DeleAction <int>(typeof(Action <int>), "Action<int>"));
            scriptService.RegType(new CSLE.RegHelper_DeleAction <object, EventArgs>(typeof(EventHandler), "EventHandler"));

            //CLScriptExt.Type_Vector3());
            InitCodeFile();
            ScriptNET.Runtime.RuntimeHost.Initialize();
        }
Esempio n. 4
0
        private void Form1_Load(object sender, EventArgs e)
        {


            scriptService = new CSLE.CLS_Environment(this); //初始化CLScript
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallAdd));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call)testCallDec));
            scriptService.RegFunction(new CSLE.RegHelper_Function((_call2)testCallAdd4));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(UserData)));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Country)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Vector3)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student.StudentAss), "Student.StudentAss"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson), "MyJson"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_ValueNumber), "MyJson.JsonNode_ValueNumber"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.IJsonNode), "MyJson.IJsonNode"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_ValueString), "MyJson.JsonNode_ValueString"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_Object), "MyJson.JsonNode_Object"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(MyJson.JsonNode_Array), "MyJson.JsonNode_Array"));
            Type t =Type.GetType("System.Collections.Generic.List`1");
            scriptService.RegType(new CSLE.RegHelper_Type(t, "List"));

            Type t2 = Type.GetType("System.Collections.Generic.Dictionary`2");
            scriptService.RegType(new CSLE.RegHelper_Type(t2, "Dictionary"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List<CLScriptExt.Student>), "List<Student>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List<CLScriptExt.Vector3>), "List<Vector3>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List<int>), "List<int>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(List<List<int>>), "List<List<int>>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(int[]), "int[]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(int[][]), "int[][]"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(string[]), "string[]"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Dictionary<string, string>), "Dictionary<string,string>"));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(CLScriptExt.Student.S1), "Student.S1"));

            scriptService.RegType(new CSLE.RegHelper_Type(typeof(DateTime)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(TimeSpan)));
            scriptService.RegType(new CSLE.RegHelper_Type(typeof(Form1)));


            scriptService.RegType(new CSLE.RegHelper_DeleAction<int>(typeof(Action<int>), "Action<int>"));
            //CLScriptExt.Type_Vector3());
            InitCodeFile();
            ScriptNET.Runtime.RuntimeHost.Initialize();

        }
Esempio n. 5
0
 void _init_Script()
 {
     envScript = new CSLE.CLS_Environment(new ScriptLogger(logger));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action(_script_help), "help"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action(_script_exit), "exit"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action(_script_clear), "clear"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action <string, string, int>(_script_artist_new), "artist_new"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action <string, string, int>(_script_artist_reset), "artist_reset"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action <string>(_script_admin_set), "admin_set"));
     envScript.RegFunction(new CSLE.RegHelper_Function(new Action <string>(_script_host_reset), "host_reset"));
     this.logger.Log_Warn("Init script engine:C#Light" + envScript.version);
 }
Esempio n. 6
0
        void _init_ScriptRPC()
        {
            envRPC = new CSLE.CLS_Environment(new ScriptLogger(logger));
            envRPC.RegType(new CSLE.RegHelper_Type(typeof(byte[]), "byte[]"));

            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPC(_rpc_help), "help"));

            //组信息
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int>(_rpc_group_info), "group_info"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int>(_rpc_group_verdetail), "group_verdetail"));


            //版本操作
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int, byte[]>(_rpc_ver_begin), "ver_begin"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int>(_rpc_ver_finish), "ver_finish"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int>(_rpc_ver_cancel), "ver_cancel"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int, string, byte[]>(_rpc_ver_addfile), "ver_addfile"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int, string, byte[]>(_rpc_ver_updatefile), "ver_updatefile"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int, string>(_rpc_ver_deletefile), "ver_deletefile"));
            envRPC.RegFunction(new CSLE.RegHelper_Function(new RPCJ <int, string, byte[]>(_rpc_ver_updatefilepro), "ver_updatefilepro"));


            this.logger.Log_Warn("Init script engine(for RPC):C#Light" + envScript.version);
        }