コード例 #1
0
ファイル: AppForm.cs プロジェクト: anooob/MovieDb
        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();
        }
コード例 #2
0
ファイル: AppForm.cs プロジェクト: anooob/MovieDb
        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();
                }
            }
        }