public void UpdateSettings() { var settings = ConverterSettings.Read(); Shared.InDir = settings.InDirectory; Shared.OutDir = settings.OutDirectory; includeIAT.Checked = settings.IncludeIAT; groupSheets.Checked = settings.GroupSheets; groupSimulations.Checked = settings.GroupSims; includeNABSA.Checked = settings.IncludeNABSA; }
private void CloseConverter(object sender, EventArgs e) { ConverterSettings settings = new ConverterSettings() { InDirectory = Shared.InDir, OutDirectory = Shared.OutDir, IncludeIAT = includeIAT.Checked, GroupSheets = groupSheets.Checked, GroupSims = groupSimulations.Checked, IncludeNABSA = includeNABSA.Checked }; settings.Write(); }
public static ConverterSettings Read() { string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/CLEMConverter/settings.json"; if (File.Exists(path)) { string json = File.ReadAllText(path); ConverterSettings settings = (new JavaScriptSerializer()).Deserialize <ConverterSettings>(json); return(settings); } return(new ConverterSettings()); }