private void CAMConfigUserControl_Disposed(object sender, EventArgs e) { _camConfig.SparkPosition = (CAMConfig.E_SparkPosition)(cbbSparkPosition.SelectedItem as ComboBoxItem).Value; _camConfig.CAVITYPartStock = double.Parse(txtCAVITYPartStock.Text); _camConfig.CAVITYFloorStock = double.Parse(txtCAVITYFloorStock.Text); CAMConfig.WriteConfig(_camConfig); }
public static void WriteConfig(CAMConfig data) { var json = Newtonsoft.Json.JsonConvert.SerializeObject(data); File.WriteAllText(_path, json); }