private void Clear() { if (this.drawer != null) { this.drawer.UnBindControl(); this.drawer.DataProvider = null; this.drawer = null; } this.graphicData_CurrentInfo = null; if (this.chartComponentController != null) { this.chartComponentController.OnDataChanged -= ChartComponentController_OnDataChanged; } }
public void Init(ChartComponentController value) { if (value == null) { return; } this.Clear(); this.chartComponentController = value; ITickData tickData = GetTickData(); CurrentInfo currentInfo = GetCurrentInfo(tickData); this.graphicData_CurrentInfo = new GraphicData_CurrentInfo(currentInfo, tickData); this.drawer = new GraphicDrawer_CurrentInfo(); this.drawer.DataProvider = this.graphicData_CurrentInfo; this.drawer.BindControl(this); this.chartComponentController.OnDataChanged += ChartComponentController_OnDataChanged; }