public void FillSessions(List <SessionType> sessionTypes) { Sessions = new List <TS>(); foreach (SessionType s in sessionTypes) { TS tS = SessionsAll.Find(x => x.SessionType == s); if (tS != null) { Sessions.Add(tS); } } Sessions.Sort((a, b) => DateTime.Compare(a.Close, b.Close)); }
private void init() { if (SessionsAll == null) { SessionsAll = new List <TS>(); } TS _ts = new TS(); _ts.Name = "Азия"; _ts.SessionType = SessionType.Asia; _ts.Open = new DateTime(1, 1, 1, 3, 0, 0); _ts.Close = new DateTime(1, 1, 1, 11, 0, 0); SessionsAll.Add(_ts); _ts = new TS(); _ts.Name = "Европа"; _ts.SessionType = SessionType.EU; _ts.Open = new DateTime(1, 1, 1, 9, 0, 0); _ts.Close = new DateTime(1, 1, 1, 17, 0, 0); SessionsAll.Add(_ts); _ts = new TS(); _ts.Name = "Америка"; _ts.SessionType = SessionType.USA; _ts.Open = new DateTime(1, 1, 1, 16, 30, 0); _ts.Close = new DateTime(1, 1, 1, 23, 0, 0); SessionsAll.Add(_ts); _ts = new TS(); _ts.Name = "Мосбиржа"; _ts.SessionType = SessionType.RUS; _ts.Open = new DateTime(1, 1, 1, 10, 0, 0); _ts.Close = new DateTime(1, 1, 1, 19, 0, 0); SessionsAll.Add(_ts); _ts = new TS(); _ts.Name = "Сутки"; _ts.SessionType = SessionType.Day; _ts.Open = new DateTime(1, 1, 1, 0, 0, 0); _ts.Close = new DateTime(1, 1, 1, 23, 59, 59); SessionsAll.Add(_ts); color = Color.Blue; TypeIndicator = IndicatorChartPaintType.Line; PaintOn = true; }