示例#1
0
        private void dgLibrary_SelectionChanged(object sender, EventArgs e)
        {
            if (dgLibrary.SelectedRows.Count < 1)
            {
                return;
            }

            Archivist.MagicObjects.Card card = cardsLibrary[dgLibrary.SelectedRows[0].Index];

            cardInfoLibrary.DataSource = card;
        }
示例#2
0
        private void dgCards_SelectionChanged(object sender, EventArgs e)
        {
            if (dgCards.SelectedRows.Count < 1)
            {
                return;
            }

            var list = ((SortableBindingList <Archivist.MagicObjects.Card>)dgCards.DataSource);

            Archivist.MagicObjects.Card card = list[dgCards.SelectedRows[0].Index];

            cardInfoCards.DataSource = card;
        }
示例#3
0
        private void DynamicAddCardToDeck_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            if (item == null)
            {
                return;
            }

            TabPage deckPage = (TabPage)item.Tag;

            if (deckPage == null)
            {
                return;
            }

            var list = ((SortableBindingList <Archivist.MagicObjects.Card>)dgCards.DataSource);

            Archivist.MagicObjects.Card card = list[dgCards.SelectedRows[0].Index];
            ((Deck)deckPage.Controls[0]).AddCard(card);
        }
示例#4
0
        private void addToLibraryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dgCards.SelectedRows.Count < 1)
            {
                return;
            }

            var list = ((SortableBindingList <Archivist.MagicObjects.Card>)dgCards.DataSource);

            Archivist.MagicObjects.Card card = list[dgCards.SelectedRows[0].Index];

            Archivist.MagicObjects.MagicCard findCard = cardsLibrary.FirstOrDefault(sel => sel.Multiverseid == card.Multiverseid);
            if (findCard != null)
            {
                findCard.Amount++;
            }
            else
            {
                cardsLibrary.Add(card.Duplicate() as Archivist.MagicObjects.MagicCard);
            }
        }