コード例 #1
0
        public void TestCancellation()
        {
            timeBasedCommand.SetCommand("foo", 1000);
            Thread.Sleep(200);

            Assert.AreSame(timeBasedCommand.CurrentCommand, "foo", "Command after adding it");

            timeBasedCommand.CancelCurrentCommand();
            Thread.Sleep(200);      // Event must have been cancelled by now

            Assert.IsNull(timeBasedCommand.CurrentCommand, "Command after cancellation");
        }
コード例 #2
0
 public override void CancelEvents()
 {
     timeBasedCommand.CancelCurrentCommand();
     lastCommand = null;
 }