Exemple #1
0
        private void m_simpleButtonWarnPanelV3UpdateCon_Click(object sender, EventArgs e)
        {
            this.m_oShcedulerUtils.startAsync(500, 100, false, () =>
            {
                //updateCon
                List <ConItemVo> lstConItemVo = _genConItemLst();
                FormUtilsEx.invoke4Control(this, () =>
                {
                    this.m_oWarnPanelV3.updateCon(lstConItemVo);
                });

                //updateWarn
                var lstWarnMsg = new List <string>();
                for (int i = 0; i < new Random().Next(0, 50); i++)
                {
                    lstWarnMsg.Add("FTC:X轴限位告警" + IDUtilsEx.gen());
                }
                FormUtilsEx.invoke4Control(this, () =>
                {
                    this.m_oWarnPanelV3.updateWarn(lstWarnMsg);
                });
            });
        }
Exemple #2
0
        private void _init()
        {
            var o = new Stopwatch();

            o.Start();
            for (int i = 0; i < 50; i++)
            {
                var oLabel = new Label();
                oLabel.Name     = "label" + i;
                oLabel.Text     = "label" + i;
                oLabel.Location = new Point(10, 20 * i);
                this.Controls.Add(oLabel);

                var oTextBox = new TextBox();
                oTextBox.Name     = "name" + i;
                oTextBox.Text     = "text" + i;
                oTextBox.Location = new Point(50, 20 * i);
                this.Controls.Add(oTextBox);
            }
            o.Stop();
            Console.WriteLine("TEXT:" + o.ElapsedMilliseconds);
            o.Start();
            for (int i = 50; i < 100; i++)
            {
                var oCombo = new ComboBox();
                oCombo.Name = "name" + i;
                oCombo.Text = "1";
                oCombo.Items.Add("1");
                oCombo.Items.Add("2");
                oCombo.Items.Add("3");
                oCombo.Location = new Point(10, 20 * i);
                this.Controls.Add(oCombo);
            }
            o.Stop();
            Console.WriteLine("COMBO:" + o.ElapsedMilliseconds);

            var oSchedulerUtils = new SchedulerUtils();

            oSchedulerUtils.startAsync(100, 100, false, () =>
            {
                FormUtilsEx.invoke4Control(this, () =>
                {
                    var o1 = new Stopwatch();
                    o1.Start();
                    for (int i = 0; i < 50; i++)
                    {
                        var oTextBox  = this.Controls.Find("name" + i, false)[0];
                        oTextBox.Text = IDUtilsEx.gen();
                    }
                    o1.Stop();
                    Console.WriteLine("REFRESH:" + o1.ElapsedMilliseconds);
                });
            });

            var oSchedulerUtils2 = new SchedulerUtils();

            oSchedulerUtils2.startAsync(100, 100, false, () =>
            {
                FormUtilsEx.invoke4Control(this, () =>
                {
                    this.simpleButton1.Text = IDUtilsEx.gen();
                });
            });
        }