Beispiel #1
0
 void HandleShowTimerMenuEvent(Timer timer, Time time)
 {
     if (!ViewModel.FixedPeriods)
     {
         menu.ShowMenu(projectVM.Model, timer, time, camerasTimeline);
     }
 }
Beispiel #2
0
 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));
     }
 }
Beispiel #3
0
        public void TimerChange_StopChanged_SeekDone()
        {
            Timer timer = new Timer {
                Nodes =
                {
                    new TimeNode {
                        Start = new Time(0), Stop = new Time(10000)
                    }
                }
            };

            projectVM.Timers.Model.Add(timer);
            Time stop = new Time(5000);

            timer.Nodes [0].Stop = stop;

            playerController.Verify(p => p.Pause(false));
            playerController.Verify(p => p.Seek(stop, true, false, true));
        }
Beispiel #4
0
        public void CleanupTimers_ProjectWithValidAndInvalidTimers_ProjectWithoutInvalidTimers()
        {
            ///Arrange

            var target = Utils.CreateProject();

            target.Timers.Clear();

            #region Valid Instances

            var validTimeNode = new TimeNode()
            {
                Start = new Time(1000),
                Stop  = new Time(2000)
            };

            var validTimeNode2 = new TimeNode()
            {
                Start = new Time(),
                Stop  = new Time(1000)
            };

            var validTimeNode3 = new TimeNode()
            {
                Start = new Time(1000),
                Stop  = new Time()
            };

            var validTimer = new Timer()
            {
                Nodes = new RangeObservableCollection <TimeNode> ()
                {
                    validTimeNode,
                    validTimeNode2,
                    validTimeNode3
                }
            };
            #endregion

            #region Invalid Instances
            var invalidTimeNode = new TimeNode()
            {
                Start = null,
                Stop  = new Time(2000)
            };

            var invalidTimeNode2 = new TimeNode()
            {
                Start = new Time(1000),
                Stop  = null
            };

            var invalidTimeNode3 = new TimeNode()
            {
                Start = null,
                Stop  = null
            };

            var invalidTimer = new Timer()
            {
                Nodes = new RangeObservableCollection <TimeNode> ()
                {
                    invalidTimeNode
                }
            };

            var invalidTimer2 = new Timer()
            {
                Nodes = new RangeObservableCollection <TimeNode> ()
                {
                    validTimeNode,
                    invalidTimeNode2,
                    validTimeNode3
                }
            };

            var invalidTimer3 = new Timer()
            {
                Nodes = new RangeObservableCollection <TimeNode> ()
                {
                    invalidTimeNode,
                    invalidTimeNode2,
                    invalidTimeNode3
                }
            };

            #endregion


            target.Timers.Add(validTimer);
            target.Timers.Add(invalidTimer);
            target.Timers.Add(invalidTimer2);
            target.Timers.Add(invalidTimer3);

            ///Act

            target.CleanupTimers();

            ///Assert

            Assert.IsNotNull(target);
            Assert.AreEqual(4, target.Timers.Count());
            Assert.AreEqual(3, target.Timers [0].Nodes.Count());
            Assert.AreEqual(0, target.Timers [1].Nodes.Count());
            Assert.AreEqual(2, target.Timers [2].Nodes.Count());
            Assert.AreEqual(0, target.Timers [3].Nodes.Count());
        }