コード例 #1
0
ファイル: FormLogEngines.cs プロジェクト: Thibor/RapChessGui
 private void FormLog_FormClosing(object sender, FormClosingEventArgs e)
 {
     locked = false;
     process.Terminate();
     if (e.CloseReason != CloseReason.FormOwnerClosing)
     {
         Hide();
         e.Cancel = true;
     }
 }
コード例 #2
0
ファイル: FormEditEngine.cs プロジェクト: Thibor/RapChessGui
        public void Uciok()
        {
            int y = 0;

            panOptions.Controls.Clear();
            optionList.Sort();
            for (int n = 0; n < optionList.list.Count; n++)
            {
                string  oName = $"optionN{n}";
                string  lName = $"optionN{n}";
                COption o     = optionList.list[n];
                switch (o.type)
                {
                case "spin":
                    var nud = new NumericUpDown();
                    nud.Name      = oName;
                    nud.Minimum   = Convert.ToInt32(o.min);
                    nud.Maximum   = Convert.ToInt32(o.max);
                    nud.Value     = Convert.ToInt32(engine.GetOption(o.name, o.def));
                    nud.Location  = new Point(3, y);
                    nud.TextAlign = HorizontalAlignment.Right;
                    panOptions.Controls.Add(nud);
                    var lab = new Label();
                    lab.Name     = lName;
                    lab.Text     = o.name;
                    lab.Location = new Point(128, y);
                    panOptions.Controls.Add(lab);
                    y += 24;
                    break;

                case "check":
                    var check = new CheckBox();
                    check.Name     = oName;
                    check.Text     = o.name;
                    check.Checked  = Convert.ToBoolean(engine.GetOption(o.name, o.def));
                    check.Location = new Point(3, y);
                    panOptions.Controls.Add(check);
                    y += 24;
                    break;
                }
            }
            process.Terminate();
        }