コード例 #1
0
        //public class Blue
        //{
        //    public int X { get; set; }
        //    public int Y
        //    {
        //        get; set;
        //    }
        //    public int T { get; set; }
        //}
        //List<Blue> panel = new List<Blue>();
        //List<Blue> Undo_history = new List<Blue>();


        private void Form1_Load(object sender, EventArgs e)
        {
            //this.button1.Visible = false;
            //this.textBox1.Visible = false;
            testApp = new SharpConnect.AppHost();
            Undo_Data undo = new Undo_Data();

            undo.DataArrived += DataArrived;
            undo.LoadData    += LoadData;
            //about
            About about = new About();

            about.Comment_Arrived += About_Comment_Arrived;
            //vaccine
            Vaccine vaccine = new Vaccine();

            vaccine.Load_vaccine += Load_vaccine;
            //user login
            Users login = new Users();

            login.Login += Login;
            //health
            Health health = new Health();

            health.Load_age_gender += Health_Load_age_gender;
            //appointment
            Notification appointment = new Notification();

            appointment.Load_Appointment += Load_Appoinement;

            testApp.RegisterModule(health);
            testApp.RegisterModule(vaccine);
            testApp.RegisterModule(about);
            testApp.RegisterModule(appointment);
            testApp.RegisterModule(login);

            string name = "[1,2,3,4,5]";
            JArray con  = JArray.Parse(name);


            Console.WriteLine(con);

            //testApp.RegisterModule(new MyModule());
            //testApp.RegisterModule(new MyModule2());
            //testApp.RegisterModule(new MyModule3());
            //testApp.RegisterModule(new MyAdvanceMathModule());
            //testApp.RegisterModule(new MMath1());
            //testApp.RegisterModule(new Undo_Data());
            //1. create
            WebServer webServer = new WebServer(8082, false, testApp.HandleRequest);
            //test websocket
            var webSocketServer = new WebSocketServer();

            webSocketServer.SetOnNewConnectionContext(ctx =>
            {
                ctx.SetMessageHandler(testApp.HandleWebSocket);
            });
            webServer.WebSocketServer = webSocketServer;
            webServer.Start();
        }
コード例 #2
0
ファイル: Form2.cs プロジェクト: kristsanapong/test
        private void Form2_Load(object sender, EventArgs e)
        {
            //txtHistory.Text = ToString();
            testApp = new SharpConnect.AppHost();

            //test websocket
            JSONLoad jsons = new JSONLoad();

            jsons.DataArrived += Module_DataArrived;
            testApp.RegisterModule(new MyModule());
            testApp.RegisterModule(new MyModule2());
            testApp.RegisterModule(new MyModule3());
            testApp.RegisterModule(new MyAdvanceMathModule());
            testApp.RegisterModule(new MMath1());
            testApp.RegisterModule(jsons);

            WebServer webServer       = new WebServer(8080, false, testApp.HandleRequest);
            var       webSocketServer = new WebSocketServer();

            webSocketServer.SetOnNewConnectionContext(ctx =>
            {
                ctx.SetMessageHandler(testApp.HandleWebSocket);
            });
            webServer.WebSocketServer = webSocketServer;
            webServer.Start();
        }