private void OnAddCommand(object param) { AddBox box = new AddBox(); box.ShowDialog(); string result = box.GetResult; if (!string.IsNullOrWhiteSpace(result)) { Page page = _database.GetPages(_currentSectionId).Where(f => f.Name == result).FirstOrDefault(); if (page == null) { page = new Page() { Name = result, Description = "", Text = "", Section = _currentSectionId }; _database.AddPage(page); Pages.Add(page); PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Pages))); } } }
private void OnAddCommand(object param) { AddBox box = new AddBox(); box.ShowDialog(); string result = box.GetResult; if (!string.IsNullOrWhiteSpace(result)) { Section section = _database.GetSections(_currentBookId).Where(f => f.Name == result).FirstOrDefault(); if (section == null) { section = new Section() { Name = result, Description = "", Book = _currentBookId }; _database.AddSection(section); Sections.Add(section); PropertyChanged.Invoke(this, new PropertyChangedEventArgs(nameof(Sections))); } } }
private void ClearButton_Click(object sender, EventArgs e) { AddBox.Clear(); stringsToCheck.Clear(); stringsCount.Clear(); richTextBox1.Clear(); richTextBox2.Clear(); count = 1; }
private void Button_Click2(object sender, RoutedEventArgs e) { size = 40; width = 435; dx = width; dy = 80; height = 10; try { int test = Convert.ToInt32(AddBox.Text); AddBox.Clear(); bin.FindNode(bin.root, test); } catch (Exception ex) { MessageBox.Show("Введите корректное значение!"); } }
private void DiscAdd_Click(object sender, EventArgs e) { AddBox.Visible = true; Ok.Visible = true; AddBox.Focus(); st_bool = false; ds_bool = true; sc_bool = false; StudDel.Enabled = false; DiscDel.Enabled = false; ScoreDel.Enabled = false; StudList.Enabled = false; DiscList.Enabled = false; ScoreList.Enabled = false; Show.Enabled = false; }
protected void OnAddCommand(object param) { AddBox box = new AddBox(); box.ShowDialog(); string result = box.GetResult; if (!string.IsNullOrWhiteSpace(result)) { Book book = _database.GetBooks(currentUser.ID).Where(f => f.Name == result).FirstOrDefault(); if (book == null) { book = new Book() { Name = result, Autor = currentUser.ID }; _database.AddBook(book); Books.Add(book); } } }
private void Button_Click3(object sender, RoutedEventArgs e) { try { int node = Convert.ToInt32(AddBox.Text); if (int.TryParse(AddBox.Text, out node)) { size = 40; width = 435; dx = width; dy = 80; height = 10; AddBox.Clear(); canva2.Children.Clear(); bin.DeleteNode(bin.root, node); bin.Print(bin.root); for (int h = 0; h < nodes.Count(); h++) { size = 40; width = 435; dx = width; dy = 80; height = 10; bin_copy.Add(nodes[h]); } nodes.Clear(); bin_copy.root = null; } else { MessageBox.Show("Введите значение!"); } } catch (Exception ex) { } }
private void btnAddBoxes_Click(object sender, RoutedEventArgs e) { AddBox addbox = new AddBox(); addbox.Show(); }