Пример #1
0
        private void OnOK(object sender, EventArgs e)
        {
            HousesData hd = lstHouses.SelectedItem as HousesData;

            if (hd != null)
            {
                DialogResult = DialogResult.OK;
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
                    }
                }
            }
        }
Пример #7
0
 public dlgHousesSystems(HousesData selected)
 {
     InitializeComponent();
     InitSystemsList(selected);
 }