AjScript.Commands.SetVariableCommand.Execute C# (CSharp) Метод

Execute() публичный Метод

public Execute ( IContext context ) : void
context IContext
Результат void
        public void Execute(IContext context)
        {
            object value = this.expression.Evaluate(context);
            context.SetValue(this.name, value);
        }

Usage Example

Пример #1
0
        public void ExecuteSetLocalVariableCommandWithVariable()
        {
            Context context = new Context();
            SetVariableCommand command = new SetVariableCommand("a", new ConstantExpression("bar"));

            command.Execute(context);

            Assert.AreEqual("bar", context.GetValue("a"));
        }