void LoadConfig() { var cfg = Setting = MapSetting.Current; txtAddress.Text = cfg.Address; txtCity.Text = cfg.City; txtLocation.Text = cfg.Location; txtLocation2.Text = cfg.Location2; chkFormatAddress.Checked = cfg.FormatAddress; //cbMap.SelectedValue = cfg.Map; //cbMethod.SelectedValue = cfg.Method; //cbCoordtype.SelectedValue = cfg.Coordtype; }
void SaveConfig() { var cfg = Setting = MapSetting.Current; cfg.Address = txtAddress.Text; cfg.City = txtCity.Text; cfg.Location = txtLocation.Text; cfg.Location2 = txtLocation2.Text; cfg.FormatAddress = chkFormatAddress.Checked; cfg.Map = (cbMap.SelectedItem as Type)?.Name; cfg.Method = (cbMethod.SelectedItem as MethodInfo)?.Name; cfg.Coordtype = cbCoordtype.SelectedItem as String; cfg.Save(); }