Beispiel #1
0
        internal void PresentSet()
        {
            if (string.IsNullOrEmpty(CurrentSet.setName))
            {
                Helpers.PopupMessages.ShowErrorMessage(this, "Please select a set first");
                return;
            }

            if (CurrentSet.getSongSetSize() == 0)
            {
                Helpers.PopupMessages.ShowErrorMessage(this, "Please add one or more songs to the set");
                return;
            }


            if (SetChanged && Helpers.PopupMessages.ShowConfirmationMessage(this, "Save changes to set '{0}' before presenting?", CurrentSet.setName))
            {
                saveSet();
            }
            else
            {
                revertSet();
            }
            CurrentSet.reloadSet();
            var frmPresent = new frmPresent(CurrentSet, DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.DisplaySettings), lbSongs.SelectedIndex);

            saveCurrentSongInSet();
            frmPresent.Show();
        }
Beispiel #2
0
        internal void ExportToHtml()
        {
            if (SetChanged && Helpers.PopupMessages.ShowConfirmationMessage(this, "Save changes to set '{0}' before Exporting to html?", CurrentSet.setName))
            {
                saveSet();
            }
            else
            {
                revertSet();
            }
            string html     = CurrentSet.getHtml(DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.TabletSettings));
            string fileName = string.Format("{0}/{1}.html", Settings.GlobalApplicationSettings.PrintFolder, CurrentSet.setName);

            File.WriteAllText(fileName, html);
        }
 void cmdRestoreSettings_Click(object sender, EventArgs e)
 {
     using (var fileDialog = new OpenFileDialog()
     {
         FileName = displayAndPrintSettings.settingsType.ToString()
     })
     {
         fileDialog.Filters.Add(FILTER);
         if (fileDialog.ShowDialog(this) == DialogResult.Ok)
         {
             displayAndPrintSettings = DisplayAndPrintSettings.loadSettings(displayAndPrintSettings.settingsType, fileDialog.FileName);
             updateGuiFromSettingsObject(displayAndPrintSettings);
             updatePreview();
         }
     }
 }
Beispiel #4
0
        private DisplayAndPrintSettings getDisplaySettingsOption(HttpRequestEventArgs e)
        {
            DisplayAndPrintSettings settings = null;
            var request = e.Request.Url.ToString();

            if (request.ToLower().Contains("/print"))
            {
                settings = DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.PrintSettings);
            }
            else if (request.ToLower().Contains("/tablet"))
            {
                settings = DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.TabletSettings);
            }
            else
            {
                settings = CurrentDisplayAndPrintSettings;
            }
            return(settings);
        }
        internal void PresentSong()
        {
            if (SongChanged)
            {
                updateSongObjectFromGui();
                if (Helpers.PopupMessages.ShowConfirmationMessage(this, "Save changes to song '{0}' before presenting?", CurrentSong.title))
                {
                    this.SaveSong();
                }
            }
            if (CurrentSong == null || CurrentSong.title == "")
            {
                Helpers.PopupMessages.ShowErrorMessage(this, "No song selected");
                return;
            }
            var frmPresent = new frmPresent(CurrentSong, DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.DisplaySettings));

            frmPresent.Closing += FrmPresent_Closing;
            frmPresent.Show();
        }
        private void loadSelectedTab(TabControl tabControl)
        {
            var selectedTabPage    = tabControl.SelectedPage;
            var selectedTabControl = tabControl.SelectedPage.Content;

            //if the control is already loaded we have nothing that we need to do
            if (selectedTabControl != null)
            {
                return;
            }

            //load the tab
            switch (selectedTabPage.Text)
            {
            case "General Settings":
                selectedTabPage.Content = new Preferences.GeneralSettingsPreferences(FileAndFolderSettings.loadSettings());
                break;

            case "Display Settings":
                selectedTabPage.Content = new Preferences.DisplayAndPrintPreferences(DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.DisplaySettings), _songToPreview);
                break;

            case "Print Settings":
                selectedTabPage.Content = new Preferences.DisplayAndPrintPreferences(DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.PrintSettings), _songToPreview);
                break;

            case "Tablet Settings":
                selectedTabPage.Content = new Preferences.DisplayAndPrintPreferences(DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.TabletSettings), _songToPreview);
                break;

            case "Shortcut Settings":
                selectedTabPage.Content = new ShortcutSettingsPreferences(Entities.ShortcutSettings.LoadSettings());
                break;

            case "User Interface Settings":
                selectedTabPage.Content = new UserInterfacePreferences();
                break;
            }
        }
Beispiel #7
0
        private void exportToPrintHtml(object sender, EventArgs e)
        {
            var option = (ExportOption)((sender as Command).Tag);

            exportToHtml(option, DisplayAndPrintSettings.loadSettings(DisplayAndPrintSettingsType.PrintSettings));
        }
 void cmdRevertSettings_Click(object sender, EventArgs e)
 {
     displayAndPrintSettings = DisplayAndPrintSettings.loadSettings(displayAndPrintSettings.settingsType);
     updateGuiFromSettingsObject(displayAndPrintSettings);
     updatePreview();
 }