void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) return; fetchstate f = (fetchstate)e.UserState; Security s = f.ChartStock; if (!blbox.ContainsKey(s.Symbol)) blbox.Add(s.Symbol, BarListImpl.FromCSV(s.Symbol,e.Result)); else blbox[s.Symbol] = BarListImpl.FromCSV(s.Symbol,e.Result); if (f.NewChart) { ChartImpl c = new ChartImpl(blbox[s.Symbol], true); c.Symbol = s.Symbol; try { c.StartPosition = FormStartPosition.Manual; c.Location = Chartographer.Properties.Settings.Default.chartstart; } catch (NullReferenceException) { } newChartData += new BarListUpdated(c.NewBarList); c.FetchStock += new SecurityDelegate(c_FetchStock); c.Move += new EventHandler(c_Move); c.Icon = Chartographer.Properties.Resources.chart; if (maxchartbox.Checked) c.WindowState = FormWindowState.Maximized; if (blackbackground.Checked) c.BackColor = Color.Black; c.Show(); } else if (newChartData != null) newChartData(blbox[s.Symbol]); }
private void button2_Click(object sender, EventArgs e) { OpenFileDialog od = new OpenFileDialog(); od.CheckFileExists = true; od.CheckPathExists = true; od.DefaultExt = "*.EPF"; od.Filter = "TickFiles|*.EPF"; od.InitialDirectory = "c:\\program files\\tradelink\\tickdata\\"; od.Multiselect = false; od.ShowDialog(); BarList bl = BarListImpl.FromEPF(od.FileName); ChartImpl c = new ChartImpl(bl, false); c.Symbol = bl.Symbol; try { c.StartPosition = FormStartPosition.Manual; c.Location = Chartographer.Properties.Settings.Default.chartstart; } catch (NullReferenceException) { } newChartData += new BarListUpdated(c.NewBarList); c.Move += new EventHandler(c_Move); c.Icon = Chartographer.Properties.Resources.chart; if (maxchartbox.Checked) c.WindowState = FormWindowState.Maximized; if (blackbackground.Checked) c.BackColor = Color.Black; c.Show(); }
void rightchart(object sender, EventArgs e) { string sym = GetVisibleSecurity(CurrentRow).Symbol; Chart c = null; try { c = new ChartImpl(bardict[sym]); } catch (Exception) { return; } c.Symbol = sym; c.Show(); }