Example #1
0
 public void Execute()
 {
     while ((bool)Condition.Value)
     {
         InnerBlock?.Execute();
     }
     NextBlock?.Execute();
 }
Example #2
0
        public void Execute()
        {
            var condition = (bool)Condition.Value;

            if (condition)
            {
                InnerBlock?.Execute();

                var next = NextBlock ?? null;

                while (next is ElseBlock || next is ElseIfBlock)
                {
                    next = next?.NextBlock;
                }

                next?.Execute();
            }
            else
            {
                NextBlock?.Execute();
            }
        }