public static void OpenChartForm(string Code, Form Owner, bool NewWindow) { if (idm == null) { idm = new FileDataManager(SymbolForm.GetSymbolTable()); } IDataProvider iDataProvider = idm[Code]; if (iDataProvider != null) { (iDataProvider as CommonDataProvider).Merge(StockDB.GetRealtimeData(Code)); if (CurrentChartForm == null || NewWindow) { CurrentChartForm = new ChartForm(); CurrentChartForm.MdiParent = Owner; CurrentChartForm.Show(); FormList.Add(CurrentChartForm); } CurrentChartForm.om.SaveObject(CurrentChartForm.Code); CurrentChartForm.Code = Code; CurrentChartForm.ChartControl.ShowChart(iDataProvider); CurrentChartForm.Activate(); CurrentChartForm.om.LoadObject(Code); } }
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 text1 = (string)this.dgList[i, this.SymbolColumn]; ChartForm.OpenChartForm(text1, base.MdiParent, NewWindow); } }
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)) { goto Label_0118; } 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); } goto Label_00FA; } case ShortcutType.Indicator: { (base.Owner as ChartForm).ChartControl.SetAreaByName(text1); goto Label_00FA; } } } else if ((base.Owner is ListForm) && (type1 == ShortcutType.Stock)) { ListForm.Current.GotoSymbol(text1); } Label_00FA: if (type1 == ShortcutType.Folder) { ListForm.Current.FolderId = int.Parse(text1); ListForm.Current.Activate(); } Label_0118: base.Close(); }
public bool PreFilterMessage(ref Message m) { if (m.Msg == 0x100) { KeyEventArgs args1 = new KeyEventArgs(((Keys)m.WParam.ToInt32()) | Control.ModifierKeys); ChartForm.HandleKey(args1); if (args1.Handled) { return(args1.Handled); } } return(false); }
private void ChartForm_Closed(object sender, EventArgs e) { FormList.Remove(this); if (CurrentChartForm == this) { StatisticForm.FreeStatistic(); if (FormList.Count > 0) { CurrentChartForm = (ChartForm)FormList[0]; } else { CurrentChartForm = null; } } om.SaveObject(Code); }
private void ChartForm_Activated(object sender, EventArgs e) { CurrentChartForm = this; }