private void btnCategory_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } //CategoryGameForm }
private void btnCBack_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } ReturnToMenu(); }
private void btnAdmin_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } //AdminForm aform = new AdminForm(volume , UserName); //aform.Show(); }
private void btnLevel_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } //LevelGameForm }
private void btnExitGame_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } exitGame = true; DialogResult = DialogResult.OK; }
private void btnClose_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } this.Close(); Cform.Show(); }
private void btnAnswer_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } answer = true; DialogResult = DialogResult.OK; }
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 = ""; } } } }
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(); }
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(); }
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 btnUserChange_Click(object sender, EventArgs e) { if (volume) { MusicManagers.playSound(); } auth.GetUsers(); auth.Show(); closing = true; this.Close(); }
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; }
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 }
//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; }