private Series LoadStock(STOCKTYPE index) { if (stockList[(int)index] != null) stockList[(int)index].Points.Dispose(); stock = new Series(stockList[(int)index].Name, stockList[(int)index].YValuesPerPoint); DataPointCollection tempPoints; if (index == STOCKTYPE.POINT) tempPoints = stockList[(int)Point_SeriesType].Points; else tempPoints = stockList[(int)index].Points; if (index == STOCKTYPE.POINT) stock.ChartType = SeriesChartType.Point; else stock.ChartType = stockList[(int)index].ChartType; stock.ChartArea = stockList[(int)index].ChartArea; stock.Color = stockList[(int)index].Color; stock.XValueType = stockList[(int)index].XValueType; foreach (DataPoint p in tempPoints) { stock.Points.Add(p.Clone()); } return stock; }
public Series this[STOCKTYPE index] { get { if (index == STOCKTYPE.AVERAGE1) MakeAverage1(); if (index == STOCKTYPE.AVERAGE2) MakeAverage2(); return LoadStock(index); } }