public void Run(IEnvironment env) { if (Value == null) { env.CreateIntermediate(Name, (int)W.Evaluate(env).Number, (int)H.Evaluate(env).Number); } else { IQueryValue value = new CanvasValue() {Canvas = Value.Evaluate(env).Canvas}; env.CreateVariable(Name, value); } }
public ICanvas CreateInput(string name) { if (_canvasLoader == null) throw new InvalidOperationException("Cannot create new input canvas when the canvas loader is null"); if (name == null) throw new ArgumentNullException("name", "Cannot use a null name for a canvas"); ICanvas canvas = _canvasLoader.LoadCanvas(name); if (canvas == null) throw new ArgumentException(string.Format("Received null canvas for \"{0}\"", name), "name"); CanvasValue value = new CanvasValue() {Canvas = canvas}; CreateVariable(canvas.Name, value); _inputs.Add(canvas); return canvas; }