private void SelectMode(FlashCardMode mode, bool initializeLayout) { //Select Mode. Both vocabulary and spelling are using same layout if (SelectedLayout != null) { SelectedLayout.Close(); } Mode = mode; SelectedLayout = (mode == FlashCardMode.Match) ? (IFlashCardLayout) new Layout_02(this) : new Layout_01(this); OnLayoutChanged(); if (initializeLayout) { SelectedLayout.InitializeControls(); } }
private void ReleaseManagedResources() { SaveSettings(); //Release managed resources foreach (NAudioPlayerWrapper ptrPlayer in Characters.Values) { ptrPlayer.Dispose(); } Characters.Clear(); Cards.Dispose(); Cards = null; OptionDialog.Dispose(); OptionDialog = null; if (SelectedLayout != null) { SelectedLayout.Close(); SelectedLayout = null; } }