示例#1
0
文件: TestRemote.cs 项目: lidbit/ATS
        public void GetQuestions(Object stateinfo)
        {
            TestRemote tr = (TestRemote)stateinfo;

            var questions = RemoteQuestionDAL.GetQuestions(tr.TestId);

            if (questions != null)
            {
                this.Invoke((MethodInvoker) delegate
                {
                    listBox1.DataSource = questions.ToList <Question>(); // runs on UI thread
                    button1.Enabled     = true;
                    button1.Text        = OldText;
                });
            }
            else
            {
                MessageBox.Show("No questions returned");
                this.Invoke((MethodInvoker) delegate
                {
                    button1.Enabled = true;
                    button1.Text    = OldText;
                });
            }
        }
示例#2
0
文件: ATSUI.cs 项目: lidbit/ATS
        private void testRemoteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TestRemote tr = new TestRemote();

            tr.Show();
        }