Ejemplo n.º 1
0
        private async Task WriteConfigAsync()
        {
            await Task.Run(() =>
            {
                GlobalData.Instance.AggregatedConfig.AccountAutoLogin.IsAutoLogin = AutoLogin;
                if (RememberMe && IsLoginSucceeded)
                {
                    GlobalData.Instance.AggregatedConfig.AccountAutoLogin.UserName = UserName;
                    GlobalData.Instance.AggregatedConfig.AccountAutoLogin.Password = Password;
                }

                try
                {
                    string json = JsonConvert.SerializeObject(GlobalData.Instance.AggregatedConfig,
                                                              Formatting.Indented);

                    File.WriteAllText(_configResultPath, json, Encoding.UTF8);
                    SscUpdateManager.WriteConfigToVersionFolder(json);
                }
                catch (Exception ex)
                {
                    Log.Logger.Error($"【write config exception】:{ex}");
                }
            });
        }
Ejemplo n.º 2
0
        private void SaveConfig()
        {
            try
            {
                string configResultPath = Path.Combine(Environment.CurrentDirectory, Common.GlobalResources.ConfigPath);

                GlobalData.Instance.AggregatedConfig.CloneConfig(MeetingConfigResult);

                string json = JsonConvert.SerializeObject(MeetingConfigResult, Formatting.Indented);

                File.WriteAllText(configResultPath, json, Encoding.UTF8);
                SscUpdateManager.WriteConfigToVersionFolder(json);
            }
            catch (Exception ex)
            {
                Log.Logger.Error($"【save config exception in setting page】:{ex}");
            }
        }