예제 #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);
        }
예제 #2
0
파일: Chart.cs 프로젝트: nacht/tradelink
 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));
     }
 }
예제 #3
0
파일: ChartMain.cs 프로젝트: larytet/JQuant
 private void downloaddata(string sym, bool newChart)
 {
     bool r = BarListImpl.DayFromGoogleAsync(sym, new BarListDelegate(gotchart));
 }