Esempio n. 1
0
 public EventToken(int start, IScheduleEvent evt, IEventColorProvider colorer)
 {
     _start = start;
     _event = evt;
     _colorer = colorer;
     Name = _event.Name;
 }
Esempio n. 2
0
 public Color this[IScheduleEvent evt]
 {
     get { return !_colors.ContainsKey(evt.Source) ? Color.Gray : _colors[evt.Source]; }
 }
Esempio n. 3
0
 public void Finish()
 {
     _event = null;
 }
Esempio n. 4
0
 public abstract void onScheduleEvent(IScheduleEvent sEvent);
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
 public bool ScheduleEvent(IScheduleEvent evt, ulong timeCode)
 {
     return _parent.ScheduleEvent(evt, timeCode);
 }
Esempio n. 7
0
        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;
        }