Esempio n. 1
0
        private void Battle_click(object sender, EventArgs e)
        {
            CampaignData.Battle battle = new CampaignData.Battle(Program.db.database.Session, Program.db.database.Battles.Count + 1);
            Program.db.database.Battles.Add(battle);
            BattleViewer viewer = new BattleViewer(battle);

            viewer.Show();
        }
Esempio n. 2
0
 private void BattleListingGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (this.BattleListingGrid.Rows.Count > e.RowIndex)
     {
         var obj    = this.BattleListingGrid.Rows[e.RowIndex].DataBoundItem;
         var battle = obj as Battle;
         if (battle != null)
         {
             BattleViewer viewer = new BattleViewer(battle);
             viewer.Show();
         }
     }
 }
        private void EncounterList_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //do this on the button column
            if (e.RowIndex > -1 && e.ColumnIndex > -1 && EncounterList.Rows.Count > e.RowIndex &&
                EncounterList.Rows[e.RowIndex].Cells.Count > e.ColumnIndex)
            {
                var Cell = EncounterList.Rows[e.RowIndex].Cells[e.ColumnIndex];
                if (Cell is DataGridViewButtonCell)
                {
                    var row = EncounterList.Rows[e.RowIndex];
                    if (row.DataBoundItem is Encounter)
                    {
                        var    encounterview = (Encounter)row.DataBoundItem;
                        Battle battle        = new Battle(Program.db.database.Session, Program.db.database.Battles.Count + 1, encounterview.monsters);
                        Program.db.database.Battles.Add(battle);

                        BattleViewer viewer = new BattleViewer(battle);
                        viewer.Show();
                    }
                }
            }
        }