Ejemplo n.º 1
0
        private void setting_Load(object sender, EventArgs e)
        {
            // 窗口布局设置
            this.FormBorderStyle = FormBorderStyle.FixedDialog; //设置边框为不可调节
            this.MaximizeBox     = false;                       //取消最大化按键
            this.MinimizeBox     = false;                       //取消最小化按键
            LayOutSet layoutset = new LayOutSet(Size.Width, Size.Height);

            layoutset.setXCenter(this.button_saveset);

            // 设置初始化
            cbarray[0] = this.checkBox_skip;
            cbarray[1] = this.checkBox_allScreen;
            XmlDocument xml = new XmlDocument();

            xml.Load(path);
            XmlNode root = xml.SelectSingleNode("setting");

            foreach (CheckBox cb in cbarray)
            {
                cb.Checked = Convert.ToBoolean(root.SelectNodes(cb.Name).Item(0).InnerText);
            }

            this.textBox_work.Text = root.SelectNodes("workTips").Item(0).InnerText;
            this.textBox_rest.Text = root.SelectNodes("restTips").Item(0).InnerText;
        }
Ejemplo n.º 2
0
        private void HaveARest_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedDialog; //设置边框为不可调节
            this.MaximizeBox     = false;                       //取消最大化按键

            // 自动处理布局 X轴
            LayOutSet layoutSet = new LayOutSet(Size.Width, Size.Height);

            layoutSet.setXCenter(this.button_Start);
            setInfor();

            XmlDocument xml = new XmlDocument();

            xml.Load(path);
            XmlNode root = xml.SelectNodes("setting").Item(0);

            this.textBox_worktime.Text = root.SelectNodes("work").Item(0).InnerText;
            this.textBox_resttime.Text = root.SelectNodes("rest").Item(0).InnerText;
        }
Ejemplo n.º 3
0
        private void havearest()
        {
            // 休息
            if (skip)
            {
                this.button_skip.Visible = true;
            }
            if (allscreen)
            {
                this.WindowState = FormWindowState.Maximized;
                this.TopMost     = true;
            }
            this.label_close.Visible = false;
            isRest = true;

            // 初始化倒计时
            string resttime2;

            if (resttime < 10)
            {
                resttime2 = "0" + resttime.ToString();
            }
            else
            {
                resttime2 = resttime.ToString();
            }
            this.label2.Text = resttime2 + ":00";
            this.label1.Text = rest;

            // 设置布局
            LayOutSet layoutset = new LayOutSet(Size.Width, Size.Height);

            layoutset.setXCenter(this.label2);
            layoutset.setXCenter(this.label1);
            layoutset.setXCenter(this.button_skip);

            // 重置倒计时
            cost       = 1;
            this.total = resttime - 1;
            timer1.Start();
        }
Ejemplo n.º 4
0
        private void beginwork()
        {
            // 工作
            if (skip)
            {
                this.button_skip.Visible = false;
            }
            if (allscreen)
            {
                this.WindowState = FormWindowState.Normal;
                this.TopMost     = false;
            }
            this.label_close.Visible = true;
            isRest = false;

            // 初始化倒计时
            string worktime2;

            if (worktime < 10)
            {
                worktime2 = "0" + worktime.ToString();
            }
            else
            {
                worktime2 = worktime.ToString();
            }
            this.label2.Text = worktime2 + ":00";
            this.label1.Text = work;

            // 设置布局
            LayOutSet layoutset = new LayOutSet(Size.Width, Size.Height);

            layoutset.setXCenter(this.label2);
            layoutset.setXCenter(this.label1);
            layoutset.setXCenter(this.button_skip);

            // 重置倒计时
            cost       = 1;
            this.total = worktime - 1;
            timer1.Start();
        }
Ejemplo n.º 5
0
        private void start_Load(object sender, EventArgs e)
        {
            // 读取设置
            XmlDocument xml = new XmlDocument();

            xml.Load(path);
            XmlNode root = xml.SelectSingleNode("setting");

            skip      = Convert.ToBoolean(root.SelectNodes("checkBox_skip").Item(0).InnerText);
            allscreen = Convert.ToBoolean(root.SelectNodes("checkBox_allScreen").Item(0).InnerText);
            work      = root.SelectNodes("workTips").Item(0).InnerText;
            rest      = root.SelectNodes("restTips").Item(0).InnerText;

            // 设置初始化
            timer1.Enabled = true;
            timer1.Start();
            string worktime2;

            if (worktime < 10)
            {
                worktime2 = "0" + worktime.ToString();
            }
            else
            {
                worktime2 = worktime.ToString();
            }
            this.label2.Text = worktime2 + ":00";
            this.label1.Text = work;

            // 设置布局
            LayOutSet layoutset = new LayOutSet(Size.Width, Size.Height);

            layoutset.setXCenter(this.label2);
            layoutset.setXCenter(this.label1);
            layoutset.setXCenter(this.button_skip);

            // 设置当前状态
            isRest = false;
        }