コード例 #1
0
        /// <summary>
        /// 停止模拟事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            CreateRealTimeData create = CreateRealTimeData.getCreateRealTimeData();

            create.Stop();
            textBox1.Text += "stop\r\n";
        }
コード例 #2
0
        /// <summary>
        /// 开始模拟按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            CreateRealTimeData create = CreateRealTimeData.getCreateRealTimeData();

            create.refreshtxt = (arg) =>
            {
                this.Invoke(new Action(() =>
                {
                    textBox1.Text += arg + "\r\n";
                }));
            };
            create.Start();
            textBox1.Text = "start\r\n";
        }