示例#1
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            cfg_reader = new Config_File_Reader();
            Input_XML.ReadXml("input_list.xml");
            bindingSource1.DataSource = Input_XML.Tables[0];
            CB_Input.ValueMember      = "value";
            CB_Input.DisplayMember    = "name";
            if (cfg_reader.exists)
            {
                file_cfg                = cfg_reader.get_cfg();
                maximum_volume          = file_cfg.maximum_volume;
                TRB_Volume_Free.Maximum = maximum_volume;
                TB_MaxVol.Text          = maximum_volume.ToString();
                IP            = file_cfg.ip;
                sp            = file_cfg.silent_preset;
                mp            = file_cfg.medium_preset;
                lp            = file_cfg.loud_preset;
                update_looper = get_new_basic_updater();
                update_looper.Start();
            }
            else
            {
                MessageBox.Show("No config file detected - please setup YRGUI", "Missing Config-File", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                Config cfg_form = new Config();
                cfg_form.Show();
            }

            STST_Label_IP.Text = IP;
        }