public void Load(AppSettingsClass appSettings) { instance = appSettings.MemberwiseClone() as AppSettingsClass; instance.PathSettings.ScriptingPath = ApplicationPathClass.GetFullPath(appSettings.PathSettings.ScriptingPath); instance.PathSettings.TempPath = ApplicationPathClass.GetFullPath(appSettings.PathSettings.TempPath); instance.PathSettings.DatabasesConfigPath = ApplicationPathClass.GetFullPath(appSettings.PathSettings.DatabasesConfigPath); }
public void SaveSettings() { fastJSON.JSON.Parameters.UseExtensions = true; AppSettingsClass appsetting = instance.MemberwiseClone() as AppSettingsClass; appsetting.PathSettings.DatabasesConfigPath = ApplicationPathClass.GetPathCode(instance.PathSettings.DatabasesConfigPath); appsetting.PathSettings.TempPath = ApplicationPathClass.GetPathCode(instance.PathSettings.TempPath); appsetting.PathSettings.ScriptingPath = ApplicationPathClass.GetPathCode(instance.PathSettings.ScriptingPath); string jsonText = fastJSON.JSON.ToNiceJSON(appsetting); File.WriteAllText(Application.StartupPath + "\\config\\AppSettings.json", jsonText); }