Ejemplo n.º 1
0
        private void Execute(IDynamicBindingContext context, bool withAutomation)
        {
            if (withAutomation)
            {
                context.AddAutomation(this);
            }

            context.AddExport(this.Settings);
            context.AddInterfaceLayer(this.Owner);

            var isValid = this.CommandBinding.Evaluate(context);

            if (isValid)
            {
                tracer.Verbose(Resources.CommandAutomation_BindingEvaluatedTrue);
                this.CommandBinding.Value.Execute();
            }
            else
            {
                tracer.Warn(Resources.CommandAutomation_BindingEvaluatedFalse,
                            this.Name, ObjectDumper.ToString(this.CommandBinding.EvaluationResults, 5));
            }
        }