public void RemovePeriodNode_PeriodNodeSelected_SelectionUpdated() { PeriodsTimelineView view = timeline.Objects.OfType <PeriodsTimelineView> ().First(); TimerTimeNodeView periodNode = (TimerTimeNodeView)view.First(); Selection sel = new Selection(periodNode, SelectionPosition.All, 0); timeline.UpdateSelection(sel); project.Periods.Remove(periodNode.Timer.Model as Period); Assert.AreEqual(0, timeline.Selections.Count); }
void AddTimeNode(TimeNodeVM timeNodeVM, TimerVM timerVM) { TimerTimeNodeView to = new TimerTimeNodeView(); to.ViewModel = timeNodeVM; to.Timer = timerVM; to.OffsetY = OffsetY; to.Height = Height; to.SecondsPerPixel = SecondsPerPixel; to.MaxTime = Duration; to.DraggingMode = DraggingMode; to.ShowName = true; to.LineColor = LineColor; AddNode(to); }
protected override void ShowMenu(Point coords) { if (ShowTimerMenuEvent != null && coords.Y >= PeriodsTimeline.OffsetY && coords.Y <= PeriodsTimeline.OffsetY + PeriodsTimeline.Height) { Timer t = null; if (Selections.Count > 0) { TimerTimeNodeView to = Selections.Last().Drawable as TimerTimeNodeView; t = to.Timer.Model; } ShowTimerMenuEvent(t, VAS.Drawing.Utils.PosToTime(coords, SecondsPerPixel)); } }