Exemple #1
0
        static void Main()
        {
            //Application.EnableVisualStyles();
            // Application.SetCompatibleTextRenderingDefault(false);
            // Application.Run(new Form1());
            // BufferTest.a();
            // System.Threading.Thread.Sleep(1000000);
            ConsumerContext.Init();
            ConsumerContext.lua.RegisterFunction("print", null, typeof(ConsumerManager).GetMethod("Print"));
            EchoClient.RunClientAsync().Wait();


            // System.Threading.Thread.CurrentThread.Suspend();
            System.Threading.Thread.Sleep(1000000);
            CodedInputStream             d;
            CodedOutputStream            b;
            ProtobufVarint32FrameDecoder c;

            // Console.WriteLine(Application.StartupPath);

            // Student student = new Student();

            Lua lua = new Lua();

            //lua.RegisterFunction("MethodA", student, student.GetType().GetMethod("MethodA"));
            lua.RegisterFunction("print", null, typeof(ConsumerManager).GetMethod("Print"));
            lua.DoFile("lua/LuaObj.lua");
            lua.RegisterFunction("print", null, typeof(ConsumerManager).GetMethod("Print"));
            // string path = "lua/com/senpure/io/ConsumerDecoder.lua";

            LuaFunction func = lua.GetFunction("hello");

            func.Call(new Student());

            // System.Threading.Thread.CurrentThread.Suspend();
        }