public SettingsForm(DllSettings dllSettings, MainSettings mainSettings, ModelLocal db) { InitializeComponent(); _dllSettings = dllSettings; _mainSettings = mainSettings; _db = db; }
private void ToolStripBtnSettings_Click(object sender, EventArgs e) { DllSettings dllSettings = _obdIfEx.OBDIf.DllSettings; MainSettings mainSettings = _obdIfEx.MainSettings; SettingsForm settingsForm = new SettingsForm(dllSettings, mainSettings, _obdTest.DbLocal); settingsForm.ShowDialog(); _obdIfEx.SaveDllSettings(dllSettings); _obdIfEx.SaveMainSettings(mainSettings); StatusLabelCommProtocol.Text = _obdIfEx.OBDIf.GetProtocol().ToString(); StatusLabelAppProtocol.Text = _obdIfEx.OBDIf.GetStandard().ToString(); StatusLabelDeviceType.Text = _obdIfEx.OBDIf.GetDevice().ToString().Replace("ELM327", "SH-VCI-302U"); if (dllSettings.AutoDetect) { StatusLabelPort.Text = "自动探测"; } else { StatusLabelPort.Text = dllSettings.ComPortName; } settingsForm.Dispose(); }
public void SaveMainSettings(MainSettings mainSettings) { MainSettings = mainSettings; SaveSetting(mainSettings, _mainSettings_xml); }