/// <summary> /// Show DB folder setting window and set settings /// </summary> /// <returns>success/fail to set</returns> private Boolean setDBFolderSettings() { if (string.IsNullOrEmpty(Properties.Settings.Default.Database_Folder)) { var dlg = new System.Windows.Forms.FolderBrowserDialog(); dlg.Description = Properties.Resources.WC_DatabaseFolder;; dlg.SelectedPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MainWindowUtil.AddUpdateAppSettings("Database_Folder", dlg.SelectedPath + "\\taskalu"); SQLiteClass.dbdirectory = dlg.SelectedPath + "\\taskalu"; SQLiteClass.dbpath = SQLiteClass.dbdirectory + "\\taskaludb.sqlite"; } else { return(false); } } else { SQLiteClass.dbdirectory = Properties.Settings.Default.Database_Folder; SQLiteClass.dbpath = SQLiteClass.dbdirectory + "\\taskaludb.sqlite"; } return(true); }
// ////////////////////////////////////////////////////////////////////////// /// <summary> /// Language Settings /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void LanguageSettings_Click(object sender, RoutedEventArgs e) { LanguageSettingsWindow dlg = new LanguageSettingsWindow(); dlg.Owner = this; dlg.WindowStartupLocation = WindowStartupLocation.CenterOwner; string settingvalue = Properties.Settings.Default.Language_Setting; if (settingvalue == "ja-JP") { LanguageSettingsWindow.language = "Japanese"; } else { LanguageSettingsWindow.language = "English"; } if (dlg.ShowDialog() == true) { if (LanguageSettingsWindow.language == "Japanese") { MainWindowUtil.AddUpdateAppSettings("Language_Setting", "ja-JP"); } else { MainWindowUtil.AddUpdateAppSettings("Language_Setting", "en-US"); } } }
/// <summary> /// Show Work folder setting window and set settings /// </summary> /// <returns>success/fail to set</returns> private Boolean setWorkFolderSettings() { if (string.IsNullOrEmpty(Properties.Settings.Default.Work_Folder)) { var dlg = new System.Windows.Forms.FolderBrowserDialog(); dlg.Description = Properties.Resources.WC_WorkFolder; dlg.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MainWindowUtil.AddUpdateAppSettings("Work_Folder", dlg.SelectedPath + "\\taskalu"); WorkHolder.workDirectory = dlg.SelectedPath + "\\taskalu"; } else { return(false); } } else { WorkHolder.workDirectory = Properties.Settings.Default.Work_Folder; } return(true); }