Beispiel #1
0
        private void 设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_currentOrder != null)
            {
                OrderSetting os = new OrderSetting();
                os.Hour   = _currentOrder.Hour;
                os.Minute = _currentOrder.Minute;

                if (os.ShowDialog() == DialogResult.OK)
                {
                    _currentOrder.Hour   = os.Hour;
                    _currentOrder.Minute = os.Minute;
                }

                RefreshTime();
            }
        }
Beispiel #2
0
        private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OrderSetting os = new OrderSetting();

            if (os.ShowDialog() == DialogResult.OK)
            {
                UserOrder order = new UserOrder(os.Hour, os.Minute);

                foreach (UserOrder temp in _orders)
                {
                    if (temp.GetTime() == order.GetTime())
                    {
                        Helper.ShowMessageBox("提示", "已添加该时间命令");
                        return;
                    }
                }
                Add(order);
            }
        }