Exemple #1
0
        public void AsyncFromGoogle()
        {
            bool r = BarListImpl.DayFromGoogleAsync("GE", new BarListDelegate(testbar));

            Assert.IsTrue(r);
            // no result yet
            Assert.IsNull(blt);
            // keep track of polls
            int polls = 0;

            // wait moment for result
            do
            {
                System.Threading.Thread.Sleep(100);
            }while ((blt == null) && (polls++ < 30));
            // verify result
            Assert.AreEqual(blt.Symbol, "GE");
            Assert.GreaterOrEqual(blt.Count, 199);
        }
Exemple #2
0
 void Chart_KeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         if ((e.KeyValue >= (int)Keys.A) && (e.KeyValue <= (int)Keys.Z))
         {
             _newstock += e.KeyCode.ToString();
         }
         if ((_newstock.Length > 0) && (e.KeyValue == (int)Keys.Back))
         {
             _newstock = _newstock.Substring(0, _newstock.Length - 1);
         }
         this.Text = chartControl1.Title + " " + _newstock;
     }
     catch (Exception) { }
     if (e.KeyValue == (int)Keys.Enter)
     {
         string stock = _newstock.ToString();
         _newstock = "";
         BarListImpl.DayFromGoogleAsync(stock, new BarListDelegate(gotchart));
     }
 }
Exemple #3
0
 private void downloaddata(string sym, bool newChart)
 {
     bool r = BarListImpl.DayFromGoogleAsync(sym, new BarListDelegate(gotchart));
 }