Ejemplo n.º 1
0
 private void Cancel()
 {
     if (SelectedLayoutGroup != null)
     {
         SelectedLayoutGroup.CancelEdit();
     }
     if (SelectedLayout != null)
     {
         SelectedLayout.CancelEdit();
     }
     AppMode = _prevAppMode;
 }
 private void OnSave()
 {
     try
     {
         SelectedLayout.Set(TempLayout);
         Layout.SaveLayouts(Layouts);
     }
     catch
     {
         //Throw message - tbi
     }
 }
Ejemplo n.º 3
0
        private void EditItem()
        {
            switch (AppMode)
            {
            case AppModes.ViewLayoutGroup:
                SelectedLayoutGroup.BeginEdit();
                AppMode = AppModes.EditLayoutGroup;
                break;

            case AppModes.ViewLayout:
                SelectedLayout.BeginEdit();
                AppMode = AppModes.EditLayout;
                break;
            }
        }
Ejemplo n.º 4
0
 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();
     }
 }
Ejemplo n.º 5
0
        private void SaveItem()
        {
            switch (AppMode)
            {
            case AppModes.AddLayoutGroup:
            case AppModes.EditLayoutGroup:
                SelectedLayoutGroup.EndEdit();
                SaveLayoutGroup();
                break;

            case AppModes.AddLayout:
            case AppModes.EditLayout:
                SelectedLayout.EndEdit();
                SaveLayout();
                break;
            }
            SaveConfiguration();
        }
Ejemplo n.º 6
0
        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;
            }
        }