Foundation for root level blocks, eg a script, or a list.
Наследование: Line, IKeyed
Пример #1
0
		public Context(Controller controller, BlockBase root, Line block, int line, Dictionary<string, Variable> variables)
		{
			Controller = controller;
			Root = root;
			Block = block;
			Line = line;
			Variables = variables;
		}
Пример #2
0
        /// <summary>
        /// Enqueue a root block to be added to the stack.
        /// </summary>
        public void Add(BlockBase root)
        {
            if (root == null)
            {
                Logger.Log(null, Logger.Level.Error, StringsScripting.Script_null_add_stack);
                return;
            }
            lock (queue)
            {
                queue.Add(new Context(this, root, root, 0, new Dictionary <string, Variable>()));

                if (queue.Count > 128)
                {
                    root.Log.ErrorF(StringsScripting.Formatted_Queue_too_big, 128);
                    queue.Clear();
                }
            }
        }
Пример #3
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;
		}
Пример #4
0
		/// <summary>
		/// Enqueue a root block to be added to the stack.
		/// </summary>
		public void Add(BlockBase root)
		{
			if (root == null)
			{
				Logger.Log(null, Logger.Level.Error, StringsScripting.Script_null_add_stack);
				return;
			}
			lock (queue)
			{
				queue.Add(new Context(this, root, root, 0, new Dictionary<string, Variable>()));

				if (queue.Count > 128)
				{
					root.Log.ErrorF(StringsScripting.Formatted_Queue_too_big, 128);
					queue.Clear();
				}
			}
		}