Ejemplo n.º 1
0
        /// <summary>
        /// Stops the last <see cref="StartLoop(ILoop)">started loop</see>.
        /// </summary>
        public void StopLastLoop()
        {
            ThrowIfDisposed();
            ThrowIfNotRunning();
            ThrowIfThereIsNotLastLoop();

            StackOfLoops.Pop();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Takes a step of the last <see cref="StartLoop(ILoop)">started loop</see>.
        /// </summary>
        public void TakeLastLoopStep()
        {
            ThrowIfDisposed();
            ThrowIfNotRunning();
            ThrowIfThereIsNotLastLoop();

            StackOfLoops.Peek().TakeStep();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Starts the loop.
        /// </summary>
        /// <param name="loop">The loop to repeated running.</param>
        /// <returns><c>true</c> if new loop started, <c>false</c> if the loop is already started.</returns>
        public void StartLoop(ILoop loop)
        {
            ThrowIfDisposed();
            ThrowIfNotRunning();

            if (loop == null)
            {
                throw new ArgumentNullException(nameof(loop));
            }

            var multilineLoop = new MultilineLoop(Runner.RunningLine, loop);

            StackOfLoops.Push(multilineLoop);
        }
Ejemplo n.º 4
0
 internal string GetStartLabelOfLastLoop()
 {
     return(StackOfLoops.Peek().StartLine.Label);
 }