コード例 #1
0
ファイル: DeckView.xaml.cs プロジェクト: fmin2958/Pamya
 public DeckView(Deck deck)
 {
     this.deck = deck.Clone();
     this.removed_deck = new Deck();
     this.save_changes = false;
     InitializeComponent();
     ShowDeck();
 }
コード例 #2
0
        public EditDeckDialog(Deck d)
        {
            CurrentDeck = d.Clone();

            if (Words.Count == 0)
                Words.Add(new Word());

            foreach (Word w in CurrentDeck.Words)
            {
                if (w.Translations == null || w.Translations.Count == 0)
                    w.Translations = new List<string>() { null };
                if (w.Examples == null || w.Examples.Count == 0)
                    w.Examples = new List<string>() { null };
                if (w.Translations[0] == null)
                    w.Translations.RemoveAt(0);
                if (w.Examples[0] == null)
                    w.Examples.RemoveAt(0);
            }

            InitializeComponent();
        }