Пример #1
0
 public override void Entered(StateControl from, Data.User user, Data.User returnUser)
 {
     base.Entered(from, user, returnUser);
     txt_newName.Text = string.Empty;
     txt_oldName.Text = string.Empty;
     dtg_ungrouped_users.DataSource = Data.UserList.Instance.ApplyGroupFilter("Ungrouped Users");
 }
Пример #2
0
        /*
         * Corey Paxton     - 4/5/2014 - Initial Version
         */
        public override void Entered(StateControl from, Data.User user, Data.User returnUser)
        {
            base.Entered(from, user, returnUser);
            this.txt_currentName.Text = user.Name;
            this.txt_newName.Text = user.Name;
            ddl_groups.DataSource = Data.GroupList.Instance;

            if (this.CurrentUser.Status == Data.User.UserType.Teacher)
            {
                // Hide group stuff, but display the password stuff
                lbl_group.Visible = false;
                ddl_groups.Visible = false;
                lbl_newPassword.Visible = true;
                lbl_newPasswordConfirm.Visible = true;
                txt_newPassword.Visible = true;
                txt_newPasswordConfirm.Visible = true;
            }
            else if (this.CurrentUser.Status == Data.User.UserType.Student)
            {
                // Display group stuff, hide password
                lbl_group.Visible = true;
                ddl_groups.Visible = true;
                lbl_newPassword.Visible = false;
                lbl_newPasswordConfirm.Visible = false;
                txt_newPassword.Visible = false;
                txt_newPasswordConfirm.Visible = false;
                if(this.CurrentUser.GroupName != null)
                    ddl_groups.SelectedItem = Data.GroupList.Instance.GetByName(this.CurrentUser.GroupName);

            }
        }
Пример #3
0
        public override void Entered(StateControl from, Data.User user, Data.User returnUser)
        {
            base.Entered(from, user, returnUser);
            // TODO this isnt working the first time it enters the screen unless you click the screen
            // Make the text field active
            this.ActiveControl = txt_answer;
            this.AcceptButton = this.btn_next;
            txt_answer.Focus();

            user.Data.game.problemTime = 0;
            timer1.Start();

            txt_answer.Text = String.Empty;

            //display the counter
            lbl_index.Text = string.Format("Question: {0} / {1}", (user.Data.game.currentProblemIndex + 1), user.Data.game.totalProblems);

            //structure the format of the problem as an equation or top to bottom
            Random displayRandomizer = new Random();
            if (displayRandomizer.Next(0, 2) == 0)
            {
                //equation form
                lbl_problem.Text = String.Format("\n\n\n\n{0}", this.CurrentUser.Data.game.currentProblem.ToString());
            }
            else
            {
                //top to bottom form
                lbl_problem.Text = this.CurrentUser.Data.game.currentProblem.TopToBottomString();
            }

            lbl_coins.Text = string.Format("Coins: {0}", this.CurrentUser.Coins.ToString());
        }
Пример #4
0
 public override void Entered(StateControl from, Data.User user, Data.User returnUser)
 {
     base.Entered(from, user, returnUser);
     gbox_groups.Visible = true;
     gbox_passwords.Visible = false;
     this.txt_username.Focus();
 }
Пример #5
0
 public override void Entered(StateControl from, Data.User user, Data.User returnUser)
 {
     this.CurrentUser = user;
     this.returnUser = returnUser;
     dtg_users_list.DataSource = Data.UserList.Instance;
     dtg_groups_groups.DataSource = Data.GroupList.Instance;
     dtg_reports_list.DataSource = Data.UserList.Instance.ApplyStatusFilter(Data.User.UserType.Student);
     manageAddButtons();
 }
Пример #6
0
 public override void Entered(StateControl from, Data.User user, Data.User returnUser)
 {
     base.Entered(from, user, returnUser);
     this.AcceptButton = this.btn_login;
     this.txt_password.Text = String.Empty;
     if (txt_password.Visible)
     {
         txt_password.Focus();
     }
     ddl_userList.DataSource = Data.UserList.Instance.GetGroupedUsers();
 }
Пример #7
0
        public override void Entered(StateControl from, Data.User user, Data.User returnUser)
        {
            base.Entered(from, user, returnUser);
            this.AcceptButton = btn_play_game;

            lbl_current_name.Text = String.Format("Welcome:{0}{1}", Environment.NewLine, this.CurrentUser.Name);
            txt_coins.Text = this.CurrentUser.Coins.ToString();
            colorPurchasableHats();
            foreach (Data.Hat hat in this.CurrentUser.OwnedHats)
            {
                enableHat(hat);
            }
            changeDisplayedHat(this.CurrentUser.selectedHat);
        }
Пример #8
0
 /// <summary>
 /// Called when the form switch to another module.
 /// </summary>
 /// <param name="to">The form it's switching to.</param>
 public virtual void Leaved(StateControl to)
 {
     //Corey thinks this is unecessary. See if it breaks by removing next cycle.
     this.CurrentUser = null;
     this.Hide();
 }
Пример #9
0
 /// <summary>
 /// Called when this form is entered (using switchTo(formName)).
 /// </summary>
 /// <param name="from">The calling form.</param>
 /// <param name="user">An optionnal user.</param>
 public virtual void Entered(StateControl from, Data.User user, Data.User returnUser)
 {
     this.Show();
     this.CurrentUser = user;
     this.returnUser = returnUser;
 }