private void LoadConfig_Click(object sender, RoutedEventArgs e) { var debugPath = "../../json.json"; string configFilePath = debugPath; var openDialog = new OpenFileDialog(); openDialog.Filter = "Config files (*.xconf)|*.xconf|All file (*.*)|*.*"; if (openDialog.ShowDialog() == false) { return; } configFilePath = openDialog.FileName; System.IO.StreamReader sw = new System.IO.StreamReader(configFilePath); var jsonConf = sw.ReadLine(); m_SysConf = JsonConvert.DeserializeObject <SystemConfig>(jsonConf); jsonConf = sw.ReadLine(); var waveBase = JsonConvert.DeserializeObject <WaveLengthLoader>(jsonConf); m_WavesDataBase = new WaveLengthLoader(waveBase); jsonConf = sw.ReadLine(); m_SelectedWaves = JsonConvert.DeserializeObject <WaveLenghts>(jsonConf); m_SelectedWaves.onWaveAdd += SelectedWaves_onWaveAdd; m_SelectedWaves.onWaveChange += SelectedWaves_onWaveChange; m_SysConf.onChange += SysConf_onChange; m_SysConf.onWaveLimitChange += SysConf_onWaveLimitChange; SysConf_onChange(this, null); m_SelectedWaves.UpdateUI(m_UIS); m_WavePlot.SetWaveLimits(m_SysConf.waveLimits); }
private void SelectedWaves_onWaveAdd(object sender, EventArgs e) { m_SelectedWaves.UpdateUI(m_UIS); }