Exemplo n.º 1
0
        private void SymbolForm_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keys1 = e.KeyCode;

            if (keys1 != Keys.Return)
            {
                if (keys1 == Keys.Escape)
                {
                    base.Close();
                    return;
                }
                return;
            }
            if ((this.dgSymbol.CurrentRowIndex < 0) || (this.dgSymbol.CurrentRowIndex >= this.dvSymbol.Count))
            {
                base.Close();
                return;
            }
            string       text1 = this.dgSymbol[this.dgSymbol.CurrentRowIndex, 2].ToString();
            ShortcutType type1 = (ShortcutType)int.Parse(this.dgSymbol[this.dgSymbol.CurrentRowIndex, 0].ToString());

            if (base.Owner is ChartForm)
            {
                switch (type1)
                {
                case ShortcutType.Stock:
                {
                    if (this.dgSymbol.CurrentRowIndex >= 0)
                    {
                        ChartForm.OpenChartForm(text1, base.Owner.MdiParent, false);
                    }
                    if (type1 == ShortcutType.Folder)
                    {
                        ListForm.Current.FolderId = int.Parse(text1);
                        ListForm.Current.Activate();
                    }
                }
                break;

                case ShortcutType.Indicator:
                {
                    (base.Owner as ChartForm).ChartControl.SetAreaByName(text1);
                    if (type1 == ShortcutType.Folder)
                    {
                        ListForm.Current.FolderId = int.Parse(text1);
                        ListForm.Current.Activate();
                    }
                }
                break;
                }
            }
            else if ((base.Owner is ListForm) && (type1 == ShortcutType.Stock))
            {
                ListForm.Current.GotoSymbol(text1);
            }
        }
Exemplo n.º 2
0
 private void OpenChart(int i, bool NewWindow)
 {
     if (StockDB.CurrentList.Count > 0)
     {
         i = (i + StockDB.CurrentList.Count) % StockDB.CurrentList.Count;
         this.dgList.CurrentRowIndex = i;
         string ticker = GetCurrentSelectedSymbol();
         ChartForm.OpenChartForm(ticker, base.MdiParent, NewWindow);
     }
 }
Exemplo n.º 3
0
        private void miUpdate_Click(object sender, EventArgs e)
        {
            YahooDataManager ydm = new YahooDataManager();

            ydm.CacheRoot = FormulaHelper.Root + "Cache";

            ChartForm.DataManager = ydm;
            string code = (string)dgList[dgList.CurrentRowIndex, 1];

            ChartForm.OpenChartForm(code, MainForm.MdiMainForm, true);
        }