コード例 #1
0
        static void Main(string[] args)
        {
            args = Environment.GetCommandLineArgs();

            new Thread(() => {
                Thread.Sleep(1000);
                try {
                    lock (Program.waiterConfig) {
                        //Monitor.Wait(Program.waiterConfig);
                        //String config = String.Concat(File.ReadAllLines("./../../../../sharedResources/tsst_config.xml"));
                        //ConfigLoader.LoadConfig(config, "1");
                        String config = String.Concat(File.ReadAllLines(args[1]));
                        ConfigLoader.LoadConfig(config, args[2]);
                        lock (Program.waiterManagement) {
                            Monitor.Pulse(Program.waiterManagement);
                        }
                    }
                } catch (Exception e) {
                    GUIWindow.PrintLog(e.StackTrace);
                }
            }).Start();

            new Thread(() => {
                lock (Program.waiterManagement) {
                    Monitor.Wait(Program.waiterManagement);
                }
                new ManagementCenterConnection();
            }).Start();


            new Thread(() => {
                lock (Program.waiterCloud){
                    Monitor.Wait(Program.waiterCloud);
                }
                cloudConnection = new CloudConnection();
            }).Start();

            new Thread(() => {
                Thread.Sleep(2500);

                /*lock (Program.waiterCloud) {
                 *  Monitor.Wait(Program.waiterCloud);
                 * }*/
                cpcc = new CPCC();
            }).Start();


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new GUIWindow());
        }
コード例 #2
0
        private void SendOutPacket()
        {
            //SendMessage();

            string destinationName = "";

            Destination.Invoke((MethodInvoker) delegate {
                destinationName = Destination.Text;
            });

            //GUIWindow.PrintLog("CONN ID: " + Program.cpcc.connectionID);
            MessageBox.Invoke((MethodInvoker) delegate {
                CloudConnection.SendMessage(CPCC.connectionID, MessageBox.Text, destinationName);
            });
        }