Exemplo n.º 1
0
        private void AppendLog(DataRow row, string message)
        {
            MethodManager.ControlInvoke(this.listBoxControl1, delegate
            {
                while (this.listBoxControl1.ItemCount > 500)
                {
                    this.listBoxControl1.Items.RemoveAt(0);
                }

                this.listBoxControl1.Items.Add(message);
                this.listBoxControl1.SelectedIndex = this.listBoxControl1.Items.Count - 1;
            });
        }
Exemplo n.º 2
0
        private void AbortFullTicketCondition(DataRow row)
        {
            MethodInvoker invoker2 = null;

            try
            {
                if (invoker2 == null)
                {
                    invoker2 = delegate
                    {
                        //this.isRunning = false;
                        this.AbortThread();
                        this.SetFormEnable(true);
                        this.btnStartInTime.Enabled = true;
                        this.timeEdit1.Enabled      = true;
                        this.btnCancel.Enabled      = true;
                        this.btnOK.Enabled          = true;
                        this.lblMessage.Text        = "休息时间,自动停止购票!";
                        this.btnOK.Text             = "自动购票";

                        Thread.Sleep(1000);
                        this.btnStartInTime.Text = "停止启动";
                        this.SetFormEnable(false);
                        this.timeEdit1.Time    = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 59, 50).AddDays(1);
                        this.timeEdit1.Enabled = false;
                        this.btnCancel.Enabled = false;
                        this.btnOK.Enabled     = false;
                        this.timerStart.Start();
                    };
                }

                MethodManager.ControlInvoke(this, invoker2);
            }
            catch
            {
                Thread.Sleep(1000);
                this.btnStartInTime.Text = "停止启动";
                this.SetFormEnable(false);
                this.timeEdit1.Time    = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 6, 59, 50).AddDays(1);
                this.timeEdit1.Enabled = false;
                this.btnCancel.Enabled = false;
                this.btnOK.Enabled     = false;
                this.timerStart.Start();
            }
        }