private void Init() { if (inited) { return; } try { this.graphicDrawer = new GraphicDrawer_Switch(); this.drawer_Candle = InitGraphicDrawer_Candle(); this.drawer_TimeLine = InitGraphicDrawer_TimeLine(); this.graphicDrawer.Drawers.Add(drawer_Candle); this.graphicDrawer.Drawers.Add(drawer_TimeLine); this.graphicDrawer.BindControl(this.control); this.graphicDrawer.Control.KeyDown += Control_KeyDown; CrossHairDrawer crossHairDrawer = new CrossHairDrawer(); crossHairDrawer.Bind(this.graphicDrawer); this.inited = true; } catch (Exception e) { LogHelper.Warn(GetType(), e); this.PaintEmpty(); } }
public GraphicDrawer_Switch_CandleReal() { drawer_Candle = new GraphicDrawer_Candle(); drawer_Real = new GraphicDrawer_TimeLine(); this.Drawers.Add(drawer_Candle); this.Drawers.Add(drawer_Real); this.Switch(0); }
private GraphicDrawer_Candle InitGraphicDrawer_Candle() { this.drawer_Candle = new GraphicDrawer_Candle(); IKLineData klineData = this.compDataController.CurrentRealTimeDataReader_Code.GetKLineData(compData.KlinePeriod); this.graphicData_Candle = GraphicDataFactory.CreateGraphicData_Candle(klineData, 0, klineData.BarPos); this.graphicData_Candle.OnGraphicDataChange += GraphicData_Candle_OnGraphicDataChange; this.drawer_Candle.DataProvider = graphicData_Candle; return(this.drawer_Candle); }