コード例 #1
0
        private void CountDown()
        {
            while (timer > 0.0)
            {
                try
                {
                    Thread.Sleep(100);
                    timer -= 0.1;
                    // timer -= 1;
                    delUpdateUITextBox DelUpdateUITextBox = new delUpdateUITextBox(UpdateClock);
                    this.timeLabel.BeginInvoke(DelUpdateUITextBox, Math.Round(timer, 1).ToString());
                }
                catch (Exception e) {
                    break;
                }
            }
            EndForm endForm = new EndForm(user, "Czas się skończył!\n" + "Odpowiedziałęś na " + correctAnswers.ToString() + " z 10 pytań poprawnie!", correctAnswers, 0.0, stream);

            try
            {
                this.Invoke((MethodInvoker) delegate
                {
                    endForm.Show();
                    this.Close();
                });
            }
            catch (Exception e)
            { }

            //var delUpdateBox = new delUpdateUITextBox(UpdateClock);
        }
コード例 #2
0
        //will get the thread started
        private void GetTheThreadStarted()
        {
            delUpdateUITextBox DelupdateUITextBox = new delUpdateUITextBox(UpdateUITextBox);

            this.textBox1.BeginInvoke(DelupdateUITextBox, "I was updated by from the thread: " + myUpdateThread.Name);


            for (int i = 0; i < 10; i++)
            {
                this.label1.BeginInvoke(DelupdateUITextBox, i.ToString());

                Thread.Sleep(1000);
            }
        }
コード例 #3
0
        private void GetTheThreadStarted()
        {
            delUpdateUITextBox DelUpdateUITextBox = new delUpdateUITextBox(UpdateUITextBox);

            this.status_wifi.BeginInvoke(DelUpdateUITextBox, status_flag);
        }