Exemplo n.º 1
0
        private void refPrt_Click(object sender, EventArgs e)
        {
            Printer.bill.PrintCore printCore = new bill.PrintCore();
            string text = printCore.findPrt();

            this.Invoke(setStatusCallback, new object[] { text });
            if (text.IndexOf("查不到名称") < 0)
            {
                timerRunner.Start();
                toolStripBtnStatus.Text = "服务已开始";
            }
            else
            {
                MessageBoxEx.Show("没有打印机");
                toolStripBtnStatus.Text = "服务已停止";
            }
        }
Exemplo n.º 2
0
        private void Print_Load(object sender, EventArgs e)
        {
            setTextCallback   = new SetTextCallback(SetText);
            setStatusCallback = new SetStatusCallback(SetStatus);

            timerRunner.AutoReset = false;               //每到指定时间Elapsed事件是触发一次(false),还是一直触发(true)
            timerRunner.Interval  = timerRunnerInterval; // 设置时间间隔
            timerRunner.Elapsed  += new System.Timers.ElapsedEventHandler(InvokeMsg);

            Printer.bill.PrintCore printCore = new bill.PrintCore();
            string text = printCore.findPrt();

            this.Invoke(setStatusCallback, new object[] { text });
            if (text.IndexOf("查不到名称") < 0)
            {
                timerRunner.Start();
                toolStripBtnStatus.Text = "服务已开始";
            }
            else
            {
                toolStripBtnStatus.Text = "服务已停止";
            }
        }