Пример #1
0
        private void searchGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int t_index = mgr.monster_list.FindIndex(x => x.ID.Equals(Convert.ToInt32(searchGridView.SelectedRows[0].Cells[12].Value)));

            mgr.current_selection = t_index;

            EditWindow edit_window = new EditWindow(mgr, t_index, "edit");

            edit_window.ShowDialog();

            /*
             * if(edit_window.edit_monster != null)
             * {
             *  searchGridView.CurrentRow.SetValues(edit_window.edit_monster.Name, edit_window.edit_monster.Type, edit_window.edit_monster.SubType, edit_window.edit_monster.Territory, edit_window.edit_monster.ChallengeRating, edit_window.edit_monster.Alignment, edit_window.edit_monster.ArmorClass, edit_window.edit_monster.HealthPoints, edit_window.edit_monster.Size, edit_window.edit_monster.PageNumber, edit_window.edit_monster.SourceBook, edit_window.edit_monster.Notes, edit_window.edit_monster.ID);
             * }
             */

            mgr = edit_window.updated_mgr;
            searchGridView.DataSource = mgr.data_table;
            UpdateList(t_index);


            //showAll();
            //searchGridView.InvalidateRow(searchGridView.SelectedRows[0].Index);
            //searchGridView.Refresh();
            //searchGridView.Update();
        }
Пример #2
0
        private void btn_newMonster_Click(object sender, EventArgs e)
        {
            int        t_index     = mgr.monster_list.FindIndex(x => x.ID.Equals(Convert.ToInt32(searchGridView.SelectedRows[0].Cells[12].Value)));
            EditWindow edit_window = new EditWindow(mgr, t_index, "new");

            edit_window.ShowDialog();

            mgr = edit_window.updated_mgr;
            searchGridView.DataSource = mgr.data_table;
            UpdateList(searchGridView.RowCount);

            //showAll();
            //searchGridView.Refresh();
            //searchGridView.Update();
        }