void FillCanvas() { TimelineObject tl; int i = 0; tl = new TimerTimeline(project.Periods.Select(p => p as Timer).ToList(), true, NodeDraggingMode.All, false, duration, i * StyleConf.TimelineCategoryHeight, Utils.ColorForRow(i), Config.Style.PaletteBackgroundDark); AddTimeline(tl, null); PeriodsTimeline = tl as TimerTimeline; i++; foreach (Timer t in project.Timers) { tl = new TimerTimeline(new List <Timer> { t }, false, NodeDraggingMode.All, false, duration, i * StyleConf.TimelineCategoryHeight, Utils.ColorForRow(i), Config.Style.PaletteBackgroundDark); AddTimeline(tl, t); } foreach (EventType type in project.EventTypes) { tl = new CategoryTimeline(project, project.EventsByType(type), duration, i * StyleConf.TimelineCategoryHeight, Utils.ColorForRow(i), playsFilter); AddTimeline(tl, type); i++; } UpdateVisibleCategories(); Update(); }
void ShowPlaysMenu(Point coords, CategoryTimeline catTimeline) { EventType ev = null; List <TimelineEvent> plays; plays = Selections.Select(p => (p.Drawable as TimelineEventObject).Event).ToList(); ev = eventsTimelines.GetKeyByValue(catTimeline); if (ev != null && ShowMenuEvent != null) { ShowMenuEvent(plays, ev, Utils.PosToTime(coords, SecondsPerPixel)); } }
protected override void ShowMenu(Point coords) { CategoryTimeline catTimeline = eventsTimelines.Values.Where( t => t.Visible && coords.Y >= t.OffsetY && coords.Y < t.OffsetY + t.Height).FirstOrDefault(); if (catTimeline != null) { ShowPlaysMenu(coords, catTimeline); } else { ShowTimersMenu(coords); } }