Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        /// <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();
        }
Ejemplo n.º 3
0
        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);
        }