Add() public method

Enqueue a root block to be added to the stack.
public Add ( BlockBase root ) : void
root BlockBase
return void
Example #1
0
		private void validateScript(Controller c, Script s, Dictionary<string, Variable> vars, StringBuilder output)
		{
			// if script has never been validated, but has errors, then do not validate, they are parse errors.
			if (s.Valid == BlockBase.Validation.NeverRan && s.Log.ErrorCount > 0)
			{
				s.SetValid(false); // will set valid to failed.
				return;
			}

			s.SetValid(true);
			if (s.List)
			{
				vars.Clear();
				s.ExecuteAsList(new Context(c, s, s, 0, vars), output);
			}
			else
			{
				c.Add(s);
				while (c.next(output))
				{

				}
			}
			s.SetValid(false);
		}
Example #2
0
		/// <summary> Add script to controller, call next until false. </summary>
		/// <returns> false if valid is not passed </returns>
		private bool runThroughScript(Controller c, BlockBase s, StringBuilder sb)
		{
			if (s.Valid != BlockBase.Validation.Passed)
				return false;
			c.Add(s);
			bool AutoFill = c.AutoFill;
			c.AutoFill = false;
			while (c.next(sb))
			{
			}
			c.AutoFill = AutoFill;
			return true;
		}