private void OnOK(object sender, EventArgs e) { HousesData hd = lstHouses.SelectedItem as HousesData; if (hd != null) { DialogResult = DialogResult.OK; } }
private void OnHelp(object sender, EventArgs e) { HousesData hd = lstHouses.SelectedItem as HousesData; if (hd != null) { MessageBox.Show(hd.SystemRef, $"The system of {hd.SystemName} means", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void OnSystemChanged(object sender, EventArgs e) { HousesData hd = lstHouses.SelectedItem as HousesData; if (hd != null) { SelectedSystem = hd; txtSelected.Text = hd.SystemName; } SetButtonsEnabled(!string.IsNullOrEmpty(hd.SystemName)); }
protected virtual void CreateHouses() { UserPreferncesDataFactory up = new UserPreferncesDataFactory(); HousesData hd = up.Data.HousesData; char system = 'K'; if (hd != null && !string.IsNullOrEmpty(hd.SystemID)) { char[] cc = hd.SystemID.ToCharArray(); system = cc[0]; } _houses = new AMHouses(JD, EventPlace.Longitude, EventPlace.Latitude, system, null); }
protected void InitSystemsList(HousesData selected) { bool enablebuttons = false; CreateSystemDataList(); lstHouses.DataSource = _lstSystems; lstHouses.DisplayMember = "SystemName"; lstHouses.ValueMember = "SystemID"; if (selected != null) { lstHouses.SelectedValue = selected.SystemID; enablebuttons = true; } SetButtonsEnabled(enablebuttons); }
private void setHouses_Click(object sender, EventArgs e) { HousesData selectedsys = null; using (dlgHousesSystems dlg = new dlgHousesSystems(_userpref.HousesData)) { if (dlg.ShowDialog() == DialogResult.OK) { selectedsys = dlg.SelectedSystem; if (selectedsys != null && !string.IsNullOrEmpty(selectedsys.SystemID) && !string.IsNullOrEmpty(selectedsys.SystemName)) { _userpref.HousesData = selectedsys; UserPreferncesDataFactory fact = new UserPreferncesDataFactory(_userpref); } } } }
public dlgHousesSystems(HousesData selected) { InitializeComponent(); InitSystemsList(selected); }