Пример #1
0
        private void btnAddDeck_Click(object sender, EventArgs e)
        {
            Deck deck = null;

            deck    = new Deck();
            deck.ID = Guid.NewGuid().ToString();

            FormChanger.SetForm(new FormEditDeck(m_CardMaker, deck));
        }
Пример #2
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            if (m_CardMaker.LoadData(Application.StartupPath + "\\CardMakerData.xml") == false)
            {
                MessageBox.Show(m_CardMaker.Error, "Fehler beim Laden", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            FormChanger.SetParent(this);
            FormChanger.SetForm(new FormMenu(m_CardMaker));
        }
Пример #3
0
        private void btnEditDeck_Click(object sender, EventArgs e)
        {
            Deck selectedDeck = null;

            if (dgvDecks.SelectedRows.Count == 1)
            {
                selectedDeck = (Deck)dgvDecks.SelectedRows[0].Tag;

                FormChanger.SetForm(new FormEditDeck(m_CardMaker, selectedDeck));
            }
        }
Пример #4
0
        private void btnEditCard_Click(object sender, EventArgs e)
        {
            Card selectedCard = null;

            if (dgvCards.SelectedRows.Count == 1)
            {
                selectedCard = (Card)dgvCards.SelectedRows[0].Tag;

                FormChanger.SetForm(new FormEditCard(m_CardMaker, selectedCard));
            }
        }
Пример #5
0
        private void btnAddCard_Click(object sender, EventArgs e)
        {
            Card card = null;

            if (cmbGroup.Text.Length > 0)
            {
                card       = new Card();
                card.ID    = Guid.NewGuid().ToString();
                card.Group = cmbGroup.Text;

                FormChanger.SetForm(new FormEditCard(m_CardMaker, card));
            }
        }
Пример #6
0
        private void btnStartGame_Click(object sender, EventArgs e)
        {
            Deck selectedDeck = null;
            Game game         = null;

            if (dgvDecks.SelectedRows.Count == 1)
            {
                selectedDeck = (Deck)dgvDecks.SelectedRows[0].Tag;

                game = new Game(m_CardMaker, selectedDeck);

                FormChanger.SetForm(new FormGame(m_CardMaker, game));
            }
        }
Пример #7
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            m_Card.Name        = edtName.Text;
            m_Card.Description = edtDescription.Text;

            if (m_CardMaker.Data.Cards.Contains(m_Card) == false)
            {
                m_CardMaker.Data.Cards.Add(m_Card);
            }

            if (m_CardMaker.SaveData() == false)
            {
                MessageBox.Show(m_CardMaker.Error, "Fehler beim Speichern", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            FormChanger.SetForm(new FormCards(m_CardMaker, m_Card.Group));
        }
Пример #8
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            m_Deck.Name        = edtName.Text;
            m_Deck.Description = edtDescription.Text;
            m_Deck.CardIDs     = m_lstCardIDsTemp;

            if (m_CardMaker.Data.Decks.Contains(m_Deck) == false)
            {
                m_CardMaker.Data.Decks.Add(m_Deck);
            }

            if (m_CardMaker.SaveData() == false)
            {
                MessageBox.Show(m_CardMaker.Error, "Fehler beim Speichern", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            FormChanger.SetForm(new FormDecks(m_CardMaker));
        }
Пример #9
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     FormChanger.SetForm(new FormDecks(m_CardMaker));
 }
Пример #10
0
 private void btnCards_Click(object sender, EventArgs e)
 {
     FormChanger.SetForm(new FormCards(m_CardMaker, string.Empty));
 }
Пример #11
0
 private void btnGame_Click(object sender, EventArgs e)
 {
     FormChanger.SetForm(new FormSelectDeck(m_CardMaker));
 }