private void Add_Click(object sender, EventArgs e) { var form = new AddMovieForm(m_context); form.Location = Location; form.StartPosition = FormStartPosition.Manual; form.Show(); AddFormManager.AddForm(form, delegate { RefreshListItems(); Show(); } ); Hide(); }
private void editButton_Click(object sender, EventArgs e) { if (entryList.SelectedItems.Count == 0) { return; } var entity = (entryList.SelectedItems[0] as EntryListViewItem).Entry; if (entity != null) { Form form = null; if (entity.Type == EntryType.Movie) { form = new EditMovieForm(m_context, entity); } else if (entity.Type == EntryType.Book) { form = new EditBookForm(m_context, entity); } if (form != null) { form.Location = Location; form.StartPosition = FormStartPosition.Manual; form.Show(); AddFormManager.AddForm(form, delegate { RefreshListItems(); Show(); } ); Hide(); } } }