Example #1
0
        /// <summary>
        /// Add a creature
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddCreature_Click(object sender, RoutedEventArgs e)
        {
            var creatureForm = new frmAddEditCreature(_creatureManager, _creatureTypeManager, _creatureDietManager);
            var result       = creatureForm.ShowDialog();

            if (result == true)
            {
                refreshCreatureList();
            }
        }
Example #2
0
 /// <summary>
 /// View the selected creature
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnViewCreature_Click(object sender, RoutedEventArgs e)
 {
     if (this.dgCreatures.SelectedItems.Count > 0)
     {
         var creatureForm = new frmAddEditCreature(_creatureManager, _creatureTypeManager, _creatureDietManager, CreatureForm.View, (Creature)this.dgCreatures.SelectedItem);
         var result       = creatureForm.ShowDialog();
         if (result == true)
         {
             refreshCreatureList();
         }
     }
     else
     {
         MessageBox.Show("You must select a creature!");
     }
 }