示例#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);
        }