protected void Edit_Button_OnClick(object sender, RoutedEventArgs e) { if (!Value) { SetValueCommand.Execute(Main); } }
protected override void EditButton_OnClick(object sender, RoutedEventArgs e) { if (Value) { SetValueCommand.Execute(Alternate); } }
public bool Set <T>(string key, T value) { ValidateKeyVal(key); ValidateInputValueNotDefault(value); var command = new SetValueCommand <T>(key, value); return(command.Execute()); }
public void CreateAndExecuteSetValueCommand() { IExpression expression = new ConstantExpression(1); SetValueCommand cmd = new SetValueCommand("one", expression); Assert.AreEqual(expression, cmd.Expression); Assert.AreEqual("one", cmd.Name); Context context = new Context(); cmd.Execute(context); Assert.AreEqual(1, context.GetValue("one")); }