예제 #1
0
        private void removeOpponent(object sender, RoutedEventArgs e)
        {
            OpponentRow selected = (OpponentRow)this.opponentList.SelectedItem;

            if (selected == null)
            {
                return;
            }
            this.opponentList.Items.Remove(selected);
            this.opponentList.Items.Refresh();
        }
예제 #2
0
        private void editOpponent(object sender, RoutedEventArgs e)
        {
            OpponentRow selected = (OpponentRow)this.opponentList.SelectedItem;

            if (selected == null)
            {
                return;
            }
            OpponentWindow ow = new OpponentWindow(this.opponents);

            ow.setExisting(selected.name, selected.cr, selected.count);
            ow.ShowDialog();
            if (!ow.isValid())
            {
                return;
            }
            selected.name  = ow.name;
            selected.cr    = ow.cr;
            selected.count = ow.count;
            SortDescription sd = this.opponentList.Items.SortDescriptions[0];

            this.opponentList.Items.SortDescriptions.Clear();
            this.opponentList.Items.SortDescriptions.Add(sd);
        }