private void SaveButton_Click(object sender, EventArgs e) { var settingsChanged = false; var validated = true; if (Directory.Exists(MainDriveTextbox.Text)) { Properties.Settings.Default.MainDrivePath = MainDriveTextbox.Text; settingsChanged = true; } else if (!string.IsNullOrWhiteSpace(MainDriveTextbox.Text)) { validated = false; } if (Directory.Exists(Shortcut1Textbox.Text)) { Properties.Settings.Default.Shortcut1Path = Shortcut1Textbox.Text; settingsChanged = true; } else if (!string.IsNullOrWhiteSpace(Shortcut1Textbox.Text)) { validated = false; } if (Directory.Exists(Shortcut2Textbox.Text)) { Properties.Settings.Default.Shortcut2Path = Shortcut2Textbox.Text; settingsChanged = true; } else if (!string.IsNullOrWhiteSpace(Shortcut2Textbox.Text)) { validated = false; } Properties.Settings.Default.Save(); if (!validated) { MessageBox.Show("Could not set one or more of the default folder paths. Please try again."); } var theme = MonolithLabel.Font.Underline ? 0 : AzureLabel.Font.Underline ? 1 : ForestLabel.Font.Underline ? 2 : 3; settingsChanged |= theme != Properties.Settings.Default.ThemeIndex; AppDesignProvider.SetTheme(this, (AppTheme)theme); AppDesignProvider.SetCurrentTab(this, (AppTheme)theme, currentTab); if (settingsChanged) { UpdateSettingsButton(); } MainDriveTextbox.Text = Properties.Settings.Default.MainDrivePath; Shortcut1Textbox.Text = Properties.Settings.Default.Shortcut1Path; Shortcut2Textbox.Text = Properties.Settings.Default.Shortcut2Path; }
public MainForm() { InitializeComponent(); timer.Tick += Timer_Tick; AppDesignProvider.SetTheme(this, (AppTheme)Properties.Settings.Default.ThemeIndex); HardDriveLabel_Click(this.HardDriveLabel, null); VersionNumberLabel.Text = "Random TV Show\r\nVersion: " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3); if (string.IsNullOrWhiteSpace(Properties.Settings.Default.MainDrivePath)) { Properties.Settings.Default.MainDrivePath = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); Properties.Settings.Default.Save(); } // On load, load shows from the hard drive LoadFromDrive(); }