private void btnCBack_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     ReturnToMenu();
 }
 private void btnCategory_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     //CategoryGameForm
 }
Exemple #3
0
 private void btnAnswer_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     answer       = true;
     DialogResult = DialogResult.OK;
 }
 private void btnClose_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     this.Close();
     Cform.Show();
 }
 private void InfoForm_Load(object sender, EventArgs e)
 {
     lText.AutoSize = true;
     if (Volume)
     {
         MusicManagers.playResultSound("simplesound1.wav");
     }
     btnOk.Location = new Point(this.Width / 2 - 40, lText.Location.Y + lText.Size.Height + 20);
 }
        private void btnLevel_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }

            //LevelGameForm
        }
Exemple #7
0
 private void btnAdmin_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     //AdminForm aform = new AdminForm(volume , UserName);
     //aform.Show();
 }
Exemple #8
0
 private void btnExitGame_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     exitGame     = true;
     DialogResult = DialogResult.OK;
 }
Exemple #9
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     MusicManagers.playSound();
     if (cbUsers.SelectedItem != null)
     {
         if (Admin && cbUsers.SelectedItem.ToString() != "Admin")
         {
             Admin = false;
             Controls.Remove(Password);
             Password.Text    = "";
             cbUsers.Location = new Point(104, 224);
             Menu mainForm = new Menu(cbUsers.SelectedItem.ToString(), this);
             mainForm.Show();
             this.Hide();
             return;
         }
         if (!Admin)
         {
             if (cbUsers.SelectedItem.ToString() == "Admin")
             {
                 Admin             = true;
                 cbUsers.Location  = new Point(cbUsers.Location.X, cbUsers.Location.Y - 40);
                 Password.Location = new Point(cbUsers.Location.X, cbUsers.Location.Y + 40);
                 Password.Height   = 31;
                 Password.Width    = 240;
                 Password.Font     = new Font("Candara", 14, FontStyle.Regular);
                 Controls.Add(Password);
             }
             else
             {
                 Menu mainForm = new Menu(cbUsers.SelectedItem.ToString(), this);
                 mainForm.Show();
                 this.Hide();
             }
         }
         else
         {
             if (Password.Text == pass)
             {
                 Menu mainForm = new Menu("Admin", this);
                 Admin = false;
                 Controls.Remove(Password);
                 Password.Text    = "";
                 cbUsers.Location = new Point(104, 224);
                 mainForm.Show();
                 this.Hide();
             }
             else
             {
                 InfoForm iform = new InfoForm("Неверный пароль!", true);
                 iform.ShowDialog();
                 Password.Text = "";
             }
         }
     }
 }
Exemple #10
0
        private void btnRegistration_Click(object sender, EventArgs e)
        {
            MusicManagers.playSound();
            Registration reg = new Registration();

            reg.ShowDialog();
            UserManager userManager = new UserManager();

            cbUsers.DataSource = userManager.GetList().Select(u => u.Login).ToList();
        }
Exemple #11
0
        private void btnCookBook_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            CategoriesForm cform = new CategoriesForm(int.Parse(lbUserLevel.Text.Split(' ')[1]), this, volume);

            cform.Show();
            this.Hide();
        }
Exemple #12
0
 private void btnUserChange_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     auth.GetUsers();
     auth.Show();
     closing = true;
     this.Close();
 }
Exemple #13
0
        private void btnGame_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            GameForm gForm = new GameForm(int.Parse(lbUserLevel.Text.Split(' ')[1]), this, UserName, volume);

            gForm.Show();
            this.Hide();
        }
 private void bpForward_Click(object sender, EventArgs e)
 {
     if (Index != recipes.Count - 1)
     {
         if (volume)
         {
             MusicManagers.playBookSound();
         }
         Index++;
         pbImage.BackgroundImage = recipes[Index].Image;
         lbName.Text             = recipes[Index].Name;
         rtbIngredients.Text     = "";
         for (int i = 0; i < recipes[Index].Ingredients.Count; i++)
         {
             if (i != recipes[Index].Ingredients.Count - 1)
             {
                 rtbIngredients.Text += recipes[Index].Ingredients[i] + "\n";
             }
             else
             {
                 rtbIngredients.Text += recipes[Index].Ingredients[i];
             }
         }
         rtbRecipe.Text = recipes[Index].Descreption.Replace("#", "");
         if (Index == recipes.Count - 1)
         {
             bpForward.Visible = false;
         }
         if (Index == 0)
         {
             pbBack.Visible = false;
         }
         else
         {
             pbBack.Visible = true;
         }
         if (rtbRecipe.Text.Length > 450)
         {
             pbDown2.Visible = true;
         }
         else
         {
             pbDown2.Visible = false;
         }
         if (rtbIngredients.Lines.Length > 6)
         {
             pbDown.Visible = true;
         }
         else
         {
             pbDown.Visible = false;
         }
     }
 }
Exemple #15
0
        private void btnAgain_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            Random        rnd   = new Random();
            List <string> words = CorrectOrder.OrderBy(i => rnd.Next()).ToList();

            UserWords.Clear();
            lbWords.Items.Clear();
            Counter = 0;
            for (int i = 0; i < words.Count; i++)
            {
                lbWords.Items.Add(words[i]);
            }
            lbWords.SelectedIndex = -1;
        }
Exemple #16
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            TestManager testManager = new TestManager(false);

            if (Counter != CorrectOrder.Count && Counter != 100)
            {
                InfoForm iform = new InfoForm("Остались незаполненные слова!", volume);
                iform.Show();
                return;
            }
            else
            {
                answer = true;
                right  = testManager.CheckIsUserRight(UserWords, CorrectOrder);
            }
            DialogResult = DialogResult.OK;
        }
        private void btnRandom_Click(object sender, EventArgs e)
        {
            if (volume)
            {
                MusicManagers.playSound();
            }
            RecipeManager recipesManager = new RecipeManager();
            List <Recipe> recipes        = recipesManager.GetList();
            List <int>    indexes        = new List <int>();

            for (int i = 0; i < recipes.Count; i++)
            {
                if (recipes[i].Level > Level)
                {
                    recipes.RemoveAt(i);
                    i--;
                }
                else
                {
                    indexes.Add(i);
                }
            }
            //TestManager
        }
Exemple #18
0
 //test nado
 private void btnAgain_Click(object sender, EventArgs e)
 {
     if (volume)
     {
         MusicManagers.playSound();
     }
     lbIngreds.Items.Clear();
     //test sdelat
     lbRecipeIngreds.Items.Clear();
     countWrong = indexes.Count;
     for (int i = 0; i < indexes.Count; i++)
     {
         RecipeIngredients[indexes[i]] = "__________";
     }
     for (int i = 0; i < RecipeIngredients.Count; i++)
     {
         lbRecipeIngreds.Items.Add(RecipeIngredients[i]);
     }
     for (int i = 0; i < RecipeIngredients.Count; i++)
     {
         lbIngreds.Items.Add(Ingredients[i]);
     }
     lbIngreds.SelectedIndex = -1;
 }