public void Run(IEnvironment env)
        {
            ICanvas canvas = env.GetVariable(CanvasName).Canvas;
            Selection.Execute(env);

            Unit[] units = Selection.Results();
            CanvasSelectionEnvironment canvasEnv = new CanvasSelectionEnvironment(env, canvas);

            foreach (var unit in units)
            {
                canvasEnv.X = unit.X;
                canvasEnv.Y = unit.Y;
                int x = XManipulation == null ? unit.X : (int) XManipulation.Evaluate(canvasEnv).Number;
                int y = YManipulation == null ? unit.Y : (int) YManipulation.Evaluate(canvasEnv).Number;
                canvas[x, y] = unit.Color;
            }
        }
        public void Execute(IEnvironment env)
        {
            if (Manipulation == null)
            {
                throw new ArgumentException("Manipulation expression cannot be null", "Manipulation");
            }

            if (Canvas == null)
            {
                throw new ArgumentException("Color cannot be null", "Canvas");
            }

            ICanvas canvas = Canvas.Evaluate(env).Canvas;

            _units = new ConcurrentBag<Unit>();

            if (env.Settings.AllowParallel)
            {
                _countdown = new CountdownEvent(canvas.Width*canvas.Height);
            }

            for (int y = 0; y < canvas.Height; ++y)
            {
                for (int x = 0; x < canvas.Width; ++x)
                {
                    CanvasSelectionEnvironment canvasEnv = new CanvasSelectionEnvironment(env, canvas);
                    canvasEnv.X = x;
                    canvasEnv.Y = y;

                    if (env.Settings.AllowParallel)
                    {
                        ThreadPool.QueueUserWorkItem(Worker, canvasEnv);
                    }
                    else
                    {
                        Worker(canvasEnv);
                    }
                }
            }

            if (env.Settings.AllowParallel)
            {
                _countdown.Wait();
                _countdown.Dispose();
            }
        }