public void updateDeck(Models.CollectionDeck deck) { for (int i = 0; i < Decks.Count; i++) { if (Decks[i].DeckID == deck.DeckID) { Decks[i] = deck.Clone(); break; } } }
public string collectionDeckToStringArgument(Models.CollectionDeck deck) { List <string> arguments; arguments = new List <string>(); foreach (Models.CollectionDeckItem cdi in deck.CardList) { arguments.Add(string.Format("{0}&{1}", cdi.Card.ID, cdi.Count)); } return(String.Join(";", arguments.ToArray())); }
// whenever you select a deck private void populateDeckContents(int id) { Models.CollectionDeck deck; stackDeckContents.Children.Clear(); listDeckContentGUI.Clear(); deck = ctrl.getDeckByID(id); this.deck = deck.Clone(); if (deck != null) { foreach (Models.CollectionDeckItem cdi in deck.CardList) { Models.DeckItemGUIModel cguim = new Models.DeckItemGUIModel(cdi, this); listDeckContentGUI.Add(cguim); stackDeckContents.Children.Add(cguim.Border); } } }