Exemple #1
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     TimerForm tf = new TimerForm();
     tf.Show();
     tf.Visible = false;
     Application.Run();
 }
Exemple #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            TimerForm tf = new TimerForm();

            tf.Show();
            tf.Visible = false;
            Application.Run();
        }
Exemple #3
0
                public timeCommand(TimerForm form, bool work)
                {
                    this.form = form;
                    this.work = work;
                    string h = "(?<hour>[0-9]{1,2})", m = "(?<minute>[0-9]{1,2})", s = "(?<second>[0-9]{1,2})";
                    this.regex = new Regex(string.Format("({0}:)?{1}:{2}|{1}", h, m, s));

                    time.Validate(x => x.Length == 1, "Exactly one time only please");
                    time.ValidateEach(x => regex.IsMatch(x), "Invalid time format");
                }
Exemple #4
0
                public timeCommand(TimerForm form, bool work)
                {
                    this.form = form;
                    this.work = work;
                    string h = "(?<hour>[0-9]{1,2})", m = "(?<minute>[0-9]{1,2})", s = "(?<second>[0-9]{1,2})";

                    this.regex = new Regex(string.Format("({0}:)?{1}:{2}|{1}", h, m, s));

                    time.Validate(x => x.Length == 1, "Exactly one time only please");
                    time.ValidateEach(x => regex.IsMatch(x), "Invalid time format");
                }
Exemple #5
0
            public MyCommand(TimerForm form)
            {
                this.form = form;

                SubCommands.Add("quit", () =>
                {
                    form.canclose = true;
                    form.Close();
                    Application.Exit();
                });
                SubCommands.Add(WORK_COMMAND, new timeCommand(form, true));
                SubCommands.Add(BREAK_COMMAND, new timeCommand(form, false));
                SubCommands.Add(PAUSE_COMMAND, form.icon.Pause);
            }
Exemple #6
0
            public MyCommand(TimerForm form)
            {
                this.form = form;

                SubCommands.Add("quit", () =>
                {
                    form.canclose = true;
                    form.Close();
                    Application.Exit();
                });
                SubCommands.Add(WORK_COMMAND, new timeCommand(form, true));
                SubCommands.Add(BREAK_COMMAND, new timeCommand(form, false));
                SubCommands.Add(PAUSE_COMMAND, form.icon.Pause);
            }