private void toolStripButtonNewMonster_Click(object sender, EventArgs e) { // Create a new, blank monster form and display it. FormMonster formMonster = new FormMonster(this); formMonster.Show(); }
// Method for selecting and loading an existing monster for // view or editing. private void GetSelectedMonster(DataRowView row) { // Cancel method if blank space is selected. if (row == null) { return; } // Create monster object from selected row. Monster monster = new Monster(); monster.Id = row.Row.Field <int>("Id"); monster.CampaignId = row.Row.Field <int>("CampaignId"); monster.Name = row.Row.Field <string>("Name"); monster.Size = row.Row.Field <string>("Size"); monster.Allignment = row.Row.Field <string>("Alignment"); monster.Description = row.Row.Field <string>("Description"); monster.Tag = row.Row.Field <string>("Tag"); monster.ChallengeRating = row.Row.Field <double>("ChallengeRating"); monster.Xp = row.Row.Field <double>("Xp"); monster.MonsterType = row.Row.Field <string>("Type"); monster.Environment = row.Row.Field <string>("Environment"); monster.Source = row.Row.Field <string>("Source"); monster.Page = row.Row.Field <string>("Page"); monster.Reference = row.Row.Field <string>("Reference"); monster.Srd = row.Row.Field <bool>("SRD"); // Create a monster form with loaded data and display it. FormMonster formMonster = new FormMonster(this, monster); formMonster.Show(); }