Exemple #1
0
        private void b_edit_Click(object sender, EventArgs e)
        {
            Card card = lb_cards.SelectedItem as Card;

            using (FormCard form = new FormCard(theme, card))
            {
                DialogResult result = form.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Card editedCard = form.GetCard();
                    theme.Cards.Remove(card);
                    theme.Cards.Add(editedCard);
                    theme.Cards.Sort();
                    RefreshForm();
                    lb_cards.SelectedItem = editedCard;
                }
            }
        }
Exemple #2
0
        private void b_new_Click(object sender, EventArgs e)
        {
            if (theme.Cards.Count >= Config.GetInstance().Tags.Count)
            {
                MessageBox.Show(this, "Não existe mais cartões disponíveis.", "Erro", MessageBoxButtons.OK);
                return;
            }

            using (FormCard form = new FormCard(theme))
            {
                DialogResult result = form.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Card card = form.GetCard();
                    theme.Cards.Add(card);
                    theme.Cards.Sort();
                    RefreshForm();
                    lb_cards.SelectedItem = card;
                }
            }
        }