Example #1
0
 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]);
     
 }
Example #2
0
        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;*.IDX";
            od.InitialDirectory = "c:\\program files\\tradelink\\tickdata\\";
            od.Multiselect      = false;
            od.ShowDialog();
            BarList bl = od.FileName.Contains(".EPF") ? BarList.FromEPF(od.FileName) : BarList.FromIDX(od.FileName);
            Chart   c  = new Chart(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();
        }
Example #3
0
        void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                return;
            }
            fetchstate f = (fetchstate)e.UserState;
            Stock      s = f.ChartStock;

            if (!blbox.ContainsKey(s.Symbol))
            {
                blbox.Add(s.Symbol, BarList.FromCSV(s.Symbol, e.Result));
            }
            else
            {
                blbox[s.Symbol] = BarList.FromCSV(s.Symbol, e.Result);
            }
            if (f.NewChart)
            {
                Chart c = new Chart(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 StockDelegate(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]);
            }
        }
Example #4
0
 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();
 }