示例#1
0
        private void LoadSettings()
        {
            if (!Directory.Exists(Constants.SettingsDirectory))
            {
                Directory.CreateDirectory(Constants.SettingsDirectory);
            }
            if (File.Exists(Constants.SettingsFilePath))
            {
                string settingsJson = File.ReadAllText(Constants.SettingsFilePath);
                if (!string.IsNullOrWhiteSpace(settingsJson))
                {
                    Settings.CurrentSettings = JsonConvert.DeserializeObject <Settings>(settingsJson);
                }
                else
                {
                    Settings.CurrentSettings = new Settings();
                    File.WriteAllText(Constants.SettingsFilePath, JsonConvert.SerializeObject(Settings.CurrentSettings));
                }
            }
            else
            {
                Settings.CurrentSettings = new Settings();
                Settings.Save();
            }

            if (string.IsNullOrWhiteSpace(Settings.CurrentSettings.MSBuildDirectoryPath) || !Settings.CurrentSettings.CompletedSetup || string.IsNullOrWhiteSpace(Settings.CurrentSettings.TextEditorExePath))
            {
                SetupWindow setup = new SetupWindow();
                setup.ShowDialog();
            }

            LoadRecentProjects();
        }
示例#2
0
        //Change MSBuild Location
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SetupWindow setup = new SetupWindow();

            setup.ShowDialog();
        }