public void OpenProject(String projectFile) { if (String.IsNullOrEmpty(projectFile)) { OpenFileDialog dialog = new OpenFileDialog(); dialog.InitialDirectory = DzAppDataConfig.sGetValue(DzAppDataConfig.LAST_LOCATION); dialog.Filter = "All Project Files(*.vgsln,*.vgstation)|*.vgsln;*.vgstation" + "|Solution File(*.vgsln)|*.vgsln" + "|Project File(*.vgstation)|*.vgstation"; if (dialog.ShowDialog() == true) { projectFile = dialog.FileName; } } if (!File.Exists(projectFile)) { return; } if (SolutionManager.IsSolutionFile(projectFile)) { SolutionManager solution = SolutionManager.OpenSolution(projectFile); if (solution == null) { return; } this.TheSolution = solution; } else { this.AddExistingProject(projectFile); } }
/// <summary> /// 获取最近打开项目列表; /// </summary> public List<String> GetRecentProjects() { // 取出最近10条记录; String values = new DzAppDataConfig().GetValue(RecentProjectKey); if (String.IsNullOrEmpty(values)) return new List<string>(); return values.Split(new String[]{ItemSeperator}, StringSplitOptions.RemoveEmptyEntries).Take(10).ToList(); }
private void ChangeAppStyle(String accent, String theme) { String appAccentKey = "AppAccent"; String appThemeKey = "AppTheme"; // 获取当前样式 DzAppDataConfig config = new DzAppDataConfig(); if (String.IsNullOrEmpty(accent)) { accent = config.GetValue(appAccentKey, "Blue"); } if (String.IsNullOrEmpty(theme)) { theme = config.GetValue(appThemeKey, "BaseLight"); } // now set the Green accent and dark theme ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent(accent), ThemeManager.GetAppTheme(theme)); config.SetValue(appAccentKey, accent); config.SetValue(appThemeKey, theme); }