コード例 #1
0
 void Init()
 {
     Instance       = this;
     this.BackColor = Colours.background;
     regions        = FileHandling.LoadRegions();      //loading regions
     interestRegion = regions[0];
 }
コード例 #2
0
        private void UpdateStock(string _file)
        {
            StockInformation _stock = FileHandling.LoadStock(_file);

            lbl_StockName.Text = _stock.name;
            lbl_Price.Text     = Convert.ToString(_stock.price);
            lbl_Dividend.Text  = Convert.ToString(_stock.dividend);
            picb_Chart.Load(HtmlHandling.GetChartAddress(_stock.name));
            MainForm.Instance.stock = _stock;
        }
コード例 #3
0
        private void Picb_RefreshClick(object sender, EventArgs e)
        {
            try {
                FileHandling.SaveStockInformation(
                    HtmlHandling.GetStockInformation(lbl_StockName.Text)
                    );
            }
            catch { MessageBox.Show("Enter a valid stock name or check internet connection"); }
            StockViewer _stockViewer = new StockViewer(false, lbl_StockName.Text);

            this.Dispose();
        }
コード例 #4
0
        void DividendForecasterFormClosing(object sender, FormClosingEventArgs e)
        {
            ScreenCapture sc       = new ScreenCapture();
            Bitmap        bmpImage = new Bitmap(sc.CaptureWindow(this.Handle));
            Bitmap        newImage = new Bitmap(Colours.rectangle.Width, Colours.rectangle.Height);
            Graphics      g        = Graphics.FromImage(newImage);

            g.DrawImage(bmpImage, -Colours.rectangle.X, -Colours.rectangle.Y);
            g.Dispose();
            MainForm.Instance.UpdateDividend(newImage);
            FileHandling.SaveImage(newImage, Application.StartupPath + "\\TEMPdividend.png", ImageFormat.Png);
            this.Dispose();
        }
コード例 #5
0
 void KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         try {
             FileHandling.SaveStockInformation(
                 HtmlHandling.GetStockInformation(txt_StockName.Text)
                 );
             StockViewer _stockViewer = new StockViewer(false, "");
             this.Dispose();
         }
         catch { MessageBox.Show("Enter a valid stock name or check internet connection"); }
     }
 }