using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AR;

namespace Project.Dialog
{
    public partial class fSystem_Setting : Form
    {
        public fSystem_Setting()
        {
            InitializeComponent();
            this.KeyDown += SystemParameter_KeyDown;
        }

        void SystemParameter_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape) this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Invalidate();
            SETTING.System.Save();
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void SystemParameter_Load(object sender, EventArgs e)
        {
            this.propertyGrid1.SelectedObject = SETTING.System;
            this.propertyGrid1.Invalidate();
        }

        private void button2_Click(object sender, EventArgs e)
        {
        }

        private void button2_Click_1(object sender, EventArgs e)
        {
            var but = sender as Button;
            var idx = short.Parse(but.Tag.ToString());
            PUB.mot.ShowParameter(idx);
        }
    }
}
