Пример #1
0
 private void UpdateStock()
 {
     timer          = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(ys.UpdateIntervalInSeconds * 1000);
     timer.Tick    += new EventHandler(Timer_Tick);
     if (ys.CheckInternetConnection())
     {
         timer.Start();
     }
 }
Пример #2
0
        private void AddYahooStockChart()
        {
            ys                         = new YahooStock();
            ys.StockPeriod             = "1d";
            ys.ChartType               = "c";
            ys.UpdateIntervalInSeconds = 20;
            ys.Symbol                  = txStockSymbol.Text;

            if (ys.CheckInternetConnection())
            {
                chartImage.Source = new BitmapImage(new Uri(ys.ChartURI));
            }
            UpdateStock();
        }
Пример #3
0
        private void Timer_Tick(object sender, EventArgs eArgs)
        {
            //chartImage.Source = new BitmapImage(new Uri(ys.ChartURI));
            ys                         = new YahooStock();
            ys.StockPeriod             = "1d";
            ys.ChartType               = "c";
            ys.UpdateIntervalInSeconds = 20;
            ys.Symbol                  = txStockSymbol.Text;

            if (ys.CheckInternetConnection())
            {
                chartImage.Source = new BitmapImage(new Uri(ys.ChartURI));
            }
            MessageBox.Show(ys.Symbol.ToString());
        }