コード例 #1
0
        private void Initialize()
        {
            DS = new DarkSkyData(Key, textBoxLat.Text, textBoxLong.Text);

            bool     run     = true;
            DateTime now     = DateTime.Now;
            DateTime current = dateTimePickerStart.Value;

            while (run)
            {
                if (current.Date.Equals(now.Date))
                {
                    run = false;
                    continue;
                }

                DS.AddDay(current);
                current = current.Add(new TimeSpan(1, 0, 0, 0));
                System.Threading.Thread.Sleep(100);
            }

            //mschart = DS.GetChart(mschart);
            zedGraph = DS.GetZedGraph(zedGraph);
            DS.Save();
            timer = new Timer();
            double minutes = .1;

            timer.Interval = (int)(minutes * 60 * 1000);
            timer.Tick    += timer_Tick;
            timer.Enabled  = true;
        }
コード例 #2
0
 private void importToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DS = new DarkSkyData();
     DS.Load();
     //mschart = DS.GetChart(mschart);
     zedGraph         = DS.GetZedGraph(zedGraph);
     textBoxLat.Text  = DS.Latitude;
     textBoxLong.Text = DS.Longitude;
 }
コード例 #3
0
ファイル: DarkSky.cs プロジェクト: jbhunter52/WeatherTracker
        public void Load()
        {
            string      json = File.ReadAllText(DataFile);
            DarkSkyData dsd  = JsonConvert.DeserializeObject <DarkSkyData>(json);

            this.Latitude  = dsd.Latitude;
            this.Longitude = dsd.Longitude;
            this.Key       = dsd.Key;
            this.DataFile  = dsd.DataFile;
            this.Data      = dsd.Data;
        }