public EventToken(int start, IScheduleEvent evt, IEventColorProvider colorer) { _start = start; _event = evt; _colorer = colorer; Name = _event.Name; }
public Color this[IScheduleEvent evt] { get { return !_colors.ContainsKey(evt.Source) ? Color.Gray : _colors[evt.Source]; } }
public void Finish() { _event = null; }
public abstract void onScheduleEvent(IScheduleEvent sEvent);
private bool ScheduleEvent(IScheduleEvent evt, ulong timeCode) { // Make sure the schedule is in the right window to add this. if (timeCode < _baseTimeCode || timeCode - _baseTimeCode >= (ulong)_schedule.Length) return false; // Insert event into the schedule. int idx = Index(timeCode); _schedule[idx].Add(evt); _waiting.Add(evt); return true; }
public bool ScheduleEvent(IScheduleEvent evt, ulong timeCode) { return _parent.ScheduleEvent(evt, timeCode); }
private void insertEvent(int row, ulong time, IScheduleEvent evt) { var token = new EventToken((int)time, evt, ColorProvider); acrossTime(time, (ulong)evt.Length, (ref EventToken[,] block) => { if (block == null) block = new EventToken[_rowCount, BlockWidth]; if (block.GetLength(0) <= row) block = block.Resize(_rowCount, block.GetLength(1)); return true; }, (ref EventToken[,] block, ulong t, int i) => { block[row, i] = token; }); if (time + (ulong)evt.Length > ColumnCount) ColumnCount = time + (ulong)evt.Length; }