Esempio n. 1
0
        /*Dialog show*/
        public static DialogResult show(string title, Bitmap img)
        {
            dialog = new ShowExDialog(title, img);

            dialog.ShowDialog();

            return(result);
        }
Esempio n. 2
0
        /*Dialog show*/
        public static DialogResult show(string title, Bitmap img)
        {
            dialog = new ShowExDialog(title , img);

            dialog.ShowDialog();

            return result;
        }
Esempio n. 3
0
        private void httpResponse(JSONObject response)
        {
            WaitDialog.close();
            int error_code = response.getInt("error_code");

            if (error_code == 0)
            {
                ChromeUtils.closeChrome();
                this.Close();
                ShowExDialog.show("第二步、背單字", Properties.Resources.memory);
                new Memory(configManager, null);
            }
            else
            {
                string message = response.getString("message");
                MessageBox.Show(message);
            }
        }
Esempio n. 4
0
 private void stopTimer()
 {
     stopWorker();
     time = 0;
     brainReceiver.stop();
     if (!configManager.getIsTest())
     {
         ChromeUtils.closeChrome();
         this.Close();
         ShowExDialog.show("第三步、測試單字", Properties.Resources.test);
         DoTest doTest = new DoTest(configManager);
         doTest.Show();
         doTest.Location = new Point(0, 0);
         ChromeUtils.openChrome(ChromeUtils.testURL + configManager.getOrderID());
     }
     else
     {
         WindowsMediaPlayer newMedia = new WindowsMediaPlayer();
         newMedia.URL = @"sound.mp3";
         newMedia.controls.play();
         if (configManager.getIsClient())
         {
             WriteFile writeFile = new WriteFile(this.runPath);
             writeFile.clientSave(configManager);
             this.Close();
             BrainChart view = new BrainChart(this.runPath, false, true, configManager);
             view.Show();
         }
         else
         {
             HttpWorker httpWorker = new HttpWorker(HttpWorker.orderFinish, httpResponse);
             JSONObject form       = new JSONObject();
             form.setString("orderID", configManager.getOrderID());
             httpWorker.setData(form);
             httpWorker.httpWorker();
             WaitDialog.show();
         }
     }
 }
Esempio n. 5
0
        private void httpResponse(JSONObject response)
        {
            WaitDialog.close();
            int error_code = response.getInt("error_code");

            if (error_code == 0)
            {
                Boolean   isTest               = radioTest.Checked;
                Boolean   isclient             = checkBoxClient.Checked;
                ArrayList list                 = bluetooth_list.getResult();
                BluetoothDeviceManager manager = (BluetoothDeviceManager)list[0];
                string        order_id         = response.getString("orderID");
                ConfigManager config_manager   = new ConfigManager(order_id, outputText.Text, int.Parse(textTestTime.Text), manager, isTest, isclient, textUserName.Text, textUserYearOld.Text);
                if (!config_manager.getIsTest())
                {
                    ShowExDialog.show("第一步、選擇單字", Properties.Resources.choose);
                    string chooseUrl = ChromeUtils.chooseURL + order_id;
                    ChromeUtils.openChrome(chooseUrl);
                    Choose choose = new Choose(config_manager);
                    choose.Show();
                    choose.Location  = new Point(0, 0);
                    this.WindowState = FormWindowState.Minimized;
                }
                else
                {
                    MessageBox.Show("準備好了?確定後開始測試");
                    ArrayList formList = new ArrayList();
                    formList.Add(this);
                    formList.Add(bluetooth_list);
                    new Memory(config_manager, formList);
                }
            }
            else
            {
                string message = response.getString("message");
                MessageBox.Show(message);
            }
        }