Ejemplo n.º 1
0
 private void StartForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     GPStrings.getSharedStrings().Save();
     GPLocationList.getShared().Save();
     GPEventList.getShared().Save();
     GPCountryList.getShared().Save();
     GPTimeZoneList.sharedTimeZones().Save();
     GPLocationProvider.SaveRecent();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LocationPickerControl()
        {
            InitializeComponent();
            ActiveControl = textBox1;

            foreach (GPCountry cn in GPCountryList.getShared().countries)
            {
                comboBox1.Items.Add(cn.getCode());
            }

            foreach (GPTimeZone tz in GPTimeZoneList.sharedTimeZones().getTimeZones())
            {
                comboBox8.Items.Add(tz.Name);
            }

            for (int i = 0; i <= 180; i++)
            {
                comboBox2.Items.Add(i.ToString());
            }
            for (int i = 0; i < 90; i++)
            {
                comboBox7.Items.Add(i.ToString());
            }
            for (int i = 0; i < 60; i++)
            {
                comboBox4.Items.Add(i.ToString());
                comboBox5.Items.Add(i.ToString());
            }

            comboBox3.Items.Add("East");
            comboBox3.Items.Add("West");
            comboBox6.Items.Add("North");
            comboBox6.Items.Add("South");

            comboBox2.SelectedIndex = 0;
            comboBox3.SelectedIndex = 0;
            comboBox4.SelectedIndex = 0;
            comboBox5.SelectedIndex = 0;
            comboBox6.SelectedIndex = 0;
            comboBox7.SelectedIndex = 0;

            UpdateEnabledButtons();

            Debugger.Log(0, "", "textBox1 focus start\n");
            textBox1.Select();
//            textBox1.Focus();
//            textBox1.Select(0, textBox1.Text.Length);
            Debugger.Log(0, "", "textBox1 focus end\n");
        }
Ejemplo n.º 3
0
        //
        // initialization of main window
        //
        public Form1()
        {
            InitializeComponent();

            //
            // initialization of combobox with list of timezones
            //
            GPTimeZoneList    tzl    = GPTimeZoneList.sharedTimeZones();
            List <GPTimeZone> tzlist = tzl.getTimeZones();

            comboBox1.BeginUpdate();
            foreach (GPTimeZone tz in tzlist)
            {
                comboBox1.Items.Add(tz);
            }
            comboBox1.EndUpdate();

            comboBox1.Text = "Europe/Bratislava";
        }
Ejemplo n.º 4
0
        private void comboBox8_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox8.SelectedIndex < 0 || comboBox8.SelectedIndex >= comboBox8.Items.Count)
            {
                return;
            }

            GPTimeZone tzone = GPTimeZoneList.sharedTimeZones().GetTimezoneByName(comboBox8.SelectedItem as string);

            if (tzone == null)
            {
                label8.Text = "-";
                return;
            }

            if (tzone.Transitions.Count == 0)
            {
                label8.Text = "-";
                return;
            }

            /*GPTimestamp ts = new GPTimestamp(DateTime.Now);
             * GPTimeZone.Transition trans = tzone.GetNextTransition(ts);
             * if (trans == null)
             * {
             *  label8.Text = "-";
             *  return;
             * }
             *
             * DateTime dt = trans.getDateTime();
             * label8.Text = dt.ToLongDateString() + " - " + dt.ToShortTimeString();*/

            if (comboBox1.SelectedItem != null && comboBox8.SelectedItem != null && tabControl1.SelectedIndex == 1)
            {
                OnSelectedLocationChanged(this, e);
            }
            ModifyNameOfCity();
        }
Ejemplo n.º 5
0
        public EditLocationProperties()
        {
            InitializeComponent();

            GPCountryList  list   = GPCountryList.getShared();
            GPTimeZoneList tzones = GPTimeZoneList.sharedTimeZones();

            comboBox1.BeginUpdate();
            foreach (GPCountry country in list.countries)
            {
                comboBox1.Items.Add(country);
            }
            comboBox1.EndUpdate();

            comboBox2.BeginUpdate();
            foreach (GPTimeZone tzone in tzones.getTimeZones())
            {
                comboBox2.Items.Add(tzone);
            }
            comboBox2.EndUpdate();

            ValidateInfo();
        }