using IndexFormula.Finance.DataProvider; using IndexFormula.Finance.Win; using MuchInfo.Chart.Data.EnumTypes; using MuchInfo.Chart.Data.Interfaces; using System; using System.Collections.Generic; namespace MuchInfo.Chart.DataAdapter { public class DataPointMananer : CacheDataManagerBase { private IDataService _dataService; private ChartWinControl _winChart; private CycleType _cycleType; private TimeSpan _timeSpan; private List _iBarDataPoints; public DataPointMananer(ChartWinControl chart) { _dataService = new DataService(); _winChart = chart; } public override IDataProvider GetData(string Code, int Count) { var dataProvider = _dataService.DataPointConvert(_iBarDataPoints, _cycleType, _timeSpan, this); dataProvider.SetStringData("Code", "XAU2"); return dataProvider; } /// /// 设置数据源 /// /// 数据源 public void SetDataSource(List barDataPoints, CycleType cycleType, TimeSpan timeSpan) { _iBarDataPoints = barDataPoints; _cycleType = cycleType; _timeSpan = timeSpan; this._winChart.Symbol = "XAU2"; _winChart.Skin = "BlackWhite"; _winChart.BindData(); _winChart.NeedRefresh(); } /// /// 更新Tick数据 /// /// BarPoint public void UpdatePoint(IBarDataPoint barDataPoint) { _winChart.NeedRefresh(); } } }