Exemplo n.º 1
0
        public challenge(User user)
        {
            InitializeComponent();
            this.user = user;
            this.cha  = new Challenge(user);

            Atimer.Tick    += Atimer_Tick;
            Atimer.Interval = 25;

            Hanzi Ahanzi = HanziIO.Read("中");

            hanziPictureBox1.Hanzi      = Ahanzi;
            hanziPictureBox1.Completed += cha.OnFinishHanzi;
            hanziPictureBox1.Enabled    = false;

            cha.FinishLevel += OnFinishLevel;
            cha.FinishLevel += user.Achievement.OnFinishLevel;
            cha.Lose        += OnLose;

            next.Visible       = true;
            next.Enabled       = true;
            timer1.Interval    = 25;
            timeMaxLength      = resttime.Width;
            resttime.BackColor = Color.Cyan;
        }
 public learn()
 {
     InitializeComponent();
     Atimer.Tick                  += Atimer_Tick;
     Atimer.Interval               = 25;
     Ale                           = this;
     Ahanzi                        = HanziIO.Read(Ahanzilist[i].Zi);
     this.hanziPictureBox1.Hanzi   = Ahanzi;
     hanziPictureBox1.CorrectDrew += new BihuaHandler(OnCorrectDrew);
     hanziPictureBox1.WrongDrew   += new BihuaHandler(OnWrongDrew);
     hanziPictureBox1.Completed   += new BihuaHandler(OnCompleted);
     this.paraphrase.Text          = Ahanzi.Info;
     this.infoLabel.Text           = "已成功载入汉字 " + "'" + Ahanzi.Zi + "'";
 }
        private void prev_Click(object sender, EventArgs e)
        {
            Sound.PlaySE("se_buttonclick");

            try
            {
                if (i - 1 < 0)
                {
                    throw new UserException("已返回字表顶端!");
                }
                Ahanzi = HanziIO.Read(Ahanzilist[--i].Zi);
                this.hanziPictureBox1.Hanzi = Ahanzi;
                this.paraphrase.Text        = Ahanzi.Info;
                this.infoLabel.Text         = "已成功载入汉字 " + "'" + Ahanzi.Zi + "'";
            }

            catch (UserException A)
            {
                wrong Awrong = new wrong(A.Message);
                Awrong.Shown      += BlockWindow;
                Awrong.FormClosed += UnblockWindow;
                Awrong.OnShow();
            }
        }