Example #1
0
        /// <summary>
        /// If the user clicks to add Special
        /// Show AddMonsterSpecial window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddSpecial_Click(object sender, RoutedEventArgs e)
        {
            AddMonsterSpecialWindow addMonsterSpecial = new AddMonsterSpecialWindow();

            addMonsterSpecial.MonsterSpecialCreated += this.OnMonsterSpecialCreated;

            addMonsterSpecial.Show();
        }
Example #2
0
 /// <summary>
 /// Check if MonsterSpecial is unique
 /// Set NewMonsterSpecial
 /// </summary>
 /// <param name="addMonsterSpecialWindow"></param>
 /// <returns></returns>
 private bool AddMonsterSpecialToList(AddMonsterSpecialWindow addMonsterSpecialWindow)
 {
     if (!MonsterSpecials.Any(x => x.Name.ToUpper() == addMonsterSpecialWindow.Name.ToUpper()))
     {
         MonsterSpecials.Add(addMonsterSpecialWindow.NewMonsterSpecial);
         return(true);
     }
     else
     {
         MessageBox.Show("A Special with that name already exists.", "Message", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         return(false);
     }
 }