Пример #1
0
        public FormTimer(string numberstr)
        {
            Log.Info("FormHandon.create,  numberstr=" + numberstr);
            al         = new ArrayList();
            alText     = new ArrayList();
            clickstate = new ArrayList();
            _classid   = Global.getClassID() + "";
            _lessonid  = Global.getLessonID() + "";
            Log.Info("debug. FormHandon._classid=" + _classid + ", _lessonid=" + _lessonid);

            _xitiId = Global.getSchoolID() + "-" + _classid + "-" + DateTime.Now.ToString("yyyyMMddHHmmss");

            //TODO: 截屏上传
            if ((EService.myppt != null && EService.myppt.isOpen()) || EService.bShowPicture)
            {
                _xitiId = "H_" + _xitiId;

                Image  img     = ScreenCapture.captureScreen(0, 0);
                string imgName = _xitiId + ".jpg";
                string imgDir  = Application.StartupPath + "\\" + DateTime.Now.ToString("yyyyMMdd");
                if (!Directory.Exists(imgDir))
                {
                    Directory.CreateDirectory(imgDir);
                }

                string imgPath = imgDir + "\\" + imgName;
                img.Save(imgPath);

                Common.uploadPicture(imgPath);
            }

            InitializeComponent();
            this.Text = "提问[" + _xitiId + "]";

            this.Height = screenHeight;
            this.Width  = screenWidth;

            StartPosition = FormStartPosition.Manual;
            SetDesktopLocation(0, screenHeight - this.Height);

            this.TopMost = true;
#if DEBUG
            this.TopMost = false;//PPTPractise
#endif
            //this.WindowState = FormWindowState.Maximized;
            this.Hide();
            this.Show();
            this.BringToFront();

            Log.Info("FormHandon Timer_start(Theout) now...");

            //t = new System.Timers.Timer(200);
            //t.Elapsed += new System.Timers.ElapsedEventHandler(Theout);
            //t.Enabled = true;
            //t.AutoReset = true;

            IntelligentRecommend.InitQuestion();
        }
Пример #2
0
        public bool restart()
        {
            Log.Info("FormHandon.clear");
            RESULT = "";
            for (int i = 0; i < clickstate.Count; i++)
            {
                PictureBox lb   = (PictureBox)al[i];
                PictureBox text = (PictureBox)alText[i];

                LabelStateEventClear(lb, text, i + 1);
                clickstate[i] = 0;
            }


            stuPushCount.Clear();
            _callnamsStr  = "";
            _rewardStr    = "";
            _criticizeStr = "";
            _querytimes   = 0;
            tm_create     = DateTime.Now;

            _xitiId = Global.getSchoolID() + "-" + _classid + "-" + DateTime.Now.ToString("yyyyMMddHHmmss");

            //TODO: 截屏上传
            if ((EService.myppt != null && EService.myppt.isOpen()) || EService.bShowPicture)
            {
                _xitiId = "H_" + _xitiId;

                Image  img     = ScreenCapture.captureScreen(0, 0);
                string imgName = _xitiId + ".jpg";
                string imgDir  = Application.StartupPath + "\\" + DateTime.Now.ToString("yyyyMMdd");
                if (!Directory.Exists(imgDir))
                {
                    Directory.CreateDirectory(imgDir);
                }

                string imgPath = imgDir + "\\" + imgName;
                img.Save(imgPath);

                Common.uploadPicture(imgPath);
            }

            Log.Info("FormHandon _xitiId=" + _xitiId + ", SetPanel now...");

            pictureBox2.Visible = false;
            pictureBox3.Visible = false;
            pictureBox4.Visible = false;


            StartPosition = FormStartPosition.Manual;
            SetDesktopLocation(0, screenHeight - this.Height);

            try
            {
                this.TopMost = true;
                this.Show();
                Global.panelshow = 1;
                this.BringToFront();
            }
            catch (Exception e)
            {
                Log.Error("Handon.clear exception.");
                return(false);
            }

            IntelligentRecommend.InitQuestion();

            //Common.ClearHandon();
            t           = new System.Timers.Timer(100);
            t.Elapsed  += new System.Timers.ElapsedEventHandler(Theout);
            t.Enabled   = true;
            t.AutoReset = true;
            return(true);
        }