public PracticeWindow(List<PracticeItem> terms, PracticeMode whichMode) { InitializeComponent(); mainMenu.Renderer = new ToolStripAeroRenderer(ToolbarTheme.MediaToolbar); if (terms.Count > 0) { queue = new PracticeQueue(terms); // TODO: Decided the default based on a setting. switch (whichMode) { case PracticeMode.Flashcards: SetMode(new FlashcardMode()); break; case PracticeMode.Default: case PracticeMode.Learn: default: SetMode(new LearnMode()); break; } } this.FormClosed += delegate { if (mode != null) mode.Stop(); }; components = components ?? new Container(); if(mode != null) components.Add(new DisposableComponent(mode)); }
public PracticeWindow(List <PracticeItem> terms, PracticeMode whichMode) { InitializeComponent(); mainMenu.Renderer = new ToolStripAeroRenderer(ToolbarTheme.MediaToolbar); if (terms.Count > 0) { queue = new PracticeQueue(terms); // TODO: Decided the default based on a setting. switch (whichMode) { case PracticeMode.Flashcards: SetMode(new FlashcardMode()); break; case PracticeMode.Default: case PracticeMode.Learn: default: SetMode(new LearnMode()); break; } } this.FormClosed += delegate { if (mode != null) { mode.Stop(); } }; components = components ?? new Container(); if (mode != null) { components.Add(new DisposableComponent(mode)); } }
private void practiceWeakPoints_Click(object sender, EventArgs e) { mode.Stop(); queue = new PracticeQueue(DataStore.Database.GetSuggestedPracticeItems(GuiConfiguration.PracticeDefaultCount)); SetMode(new LearnMode()); }