示例#1
0
文件: Program.cs 项目: zhiyix/Alarm
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     TimerForm tf = new TimerForm();
     tf.Show();
     tf.Visible = false;
     Application.Run();
 }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            TimerForm tf = new TimerForm();

            tf.Show();
            tf.Visible = false;
            Application.Run();
        }
示例#3
0
文件: MyCommand.cs 项目: zhiyix/Alarm
                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");
                }
示例#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");
                }
示例#5
0
文件: MyCommand.cs 项目: zhiyix/Alarm
            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);
            }
示例#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);
            }