Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            listBox2.Items.Clear();
            foreach (var c in Controls)
            {
                if (c is TextBox)
                {
                    (c as TextBox).Enabled = false;
                }
                if (c is GroupBox)
                {
                    foreach (var t in (c as GroupBox).Controls)
                    {
                        if (t is TextBox)
                        {
                            (t as TextBox).Enabled = false;
                        }
                    }
                }
            }
            button1.Enabled = false;
            button2.Enabled = false;
            button3.Enabled = false;
            button4.Enabled = true;

            WorkTime.Start(this, int.Parse(textBox0.Text));
            Logger.WriteLine("Производство запущенно.");
            WorkTime.WorkTimeTick += ShowWorkTime;
            WorkTime.FreeTimeTick += ShowFreeTime;
            WorkTime.WorkTimeTick += CheckListBox;
            Workshop1.Start();
            Workshop2.Start();
            Workshop3.Start();
            Workshop4.Start();
            Workshop5.Start();
        }
Exemplo n.º 2
0
 private void ShowFreeTime()
 {
     Text = WorkTime.GetTimeString();
 }