示例#1
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Util.Preset preset = new Util.Preset();
     preset.savePreset(this.PresetPath, this.AppName, this.PresetName);
     Application.ExitThread();
     Environment.Exit(0);
 }
示例#2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Console.WriteLine(Properties.Settings.Default.WIN_PRESET);
            instance   = this;
            AppName    = this.appBox.AppName;
            PresetName = this.presetBox.PresetName;
            Util.Preset preset = new Util.Preset();
            preset.getPresetFiles();

            Util.MainRender render = new Util.MainRender();
            render.updateUI();
            //subOverlay.showGroup(currentGroup, payloads[currentGroup].groupName);
            //subOverlay.Show();

            //폼 로드시 시리얼 포트 검색
            try
            {
                if (InitSerialPort())
                {
                    if (sp.IsOpen)
                    {
                        usbstate.Text      = "Device Connect";
                        usbstate.ForeColor = Color.FromArgb(51, 153, 255);
                        Console.WriteLine(sp.PortName + "이 열려 져있습니다.");
                        notice("Connecting..");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#3
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     try
     {
         if (sp.IsOpen)
         {
             sp.Close();
         }
         Util.Preset preset = new Util.Preset();
         preset.savePreset(this.PresetPath, this.AppName, this.PresetName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }