コード例 #1
0
        private void AddLeaderMenu_Click(object sender, RoutedEventArgs e)
        {
            AddUpdateDialog dialog = new AddUpdateDialog();

            if (dialog.ShowDialog() == true)
            {
                chatBot.gymBotCommand.AddOrUpdateLeader(dialog.leader);
            }
        }
コード例 #2
0
        private void UpdateLeaderMenu_Click(object sender, RoutedEventArgs e)
        {
            SelectLeaderDialog selectLeaderDialog = new SelectLeaderDialog(chatBot.gymBotCommand.gymLeaders, "Modify gym information for");

            if (selectLeaderDialog.ShowDialog() == true)
            {
                var leader = from l in chatBot.gymBotCommand.gymLeaders
                             where l.Name.ToLower() == selectLeaderDialog.SelectedLeader.ToLower()
                             select l;
                AddUpdateDialog dialog = new AddUpdateDialog(leader.FirstOrDefault());
                if (dialog.ShowDialog() == true)
                {
                    chatBot.gymBotCommand.AddOrUpdateLeader(dialog.leader);
                }
            }
        }