예제 #1
0
        private void stopBtn_Click(object sender, EventArgs e)
        {
            string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            this.stopLbl.Text = ts;
            Settings.ButtonSpec bs = new Settings.ButtonSpec("Stop", "STOP", "Stopped at " + ts);
            this.addRow(bs);
            timer1.Stop();
        }
예제 #2
0
        private void button_Click(object sender, EventArgs e)
        {
            Button btn   = (Button)sender;
            string label = btn.Text;

            Settings.ButtonSpec bs = this.settings.getButtonSpec(label);
            this.addRow(bs);
            this.needToSave = true;
        }
예제 #3
0
        private void startBtn_Click(object sender, EventArgs e)
        {
            string ts = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            this.saveFileName  = DateTime.Now.ToString("yyyyMMdd_HHmmss");
            this.startLbl.Text = ts;
            Settings.ButtonSpec bs = new Settings.ButtonSpec("Start", "START", "Started at " + ts);
            this.addRow(bs);
            timer1.Start();
        }
예제 #4
0
        private void addRow(Settings.ButtonSpec bs)
        {
            int r;

            Settings.ColorSet cs = this.settings.getColorSet(bs.buttonType);
            Color             fg = this.getColorFromString(cs.fgColor);
            Color             bg = this.getColorFromString(cs.bgColor);
            List <string>     ls = new List <string>();

            ls.Add(this.getTime());
            ls.Add(bs.buttonType);
            ls.Add(bs.buttonMessage);
            r = dataGridView1.Rows.Add(ls.ToArray());
            DataGridViewRow row = dataGridView1.Rows[r];

            for (int i = 0; i < row.Cells.Count; i++)
            {
                row.Cells[i].Style.ForeColor = fg;
                row.Cells[i].Style.BackColor = bg;
            }
        }