public ActionResult <IEnumerable <string> > Get() { var req = new TxnReq { SeqId = 1, Reference = "123" }; _commandWrapper.Execute(req); _remoteWrapper.Execute(req); return(new string[] { "value1", "value2" }); }
public void Bind(ICommandWrapper cmd, Control clickable) { var bi = new CommandToClickCommandEnabledUpdater(cmd, clickable); this.bindings.Add(bi); // TODO implemen can execute changed in the same manner clickable.Click += async(object sender, EventArgs e) => { if (cmd.CanExecute(null)) { await cmd.Execute(null); } }; }
public void Bind(ICommandWrapper cmd, ToolStripItem clickable) { var bi = new CommandToControlBindingItem(cmd, clickable); this.bindings.Add(bi); clickable.Enabled = cmd.CanExecute(null); cmd.CanExecuteChanged += (object sender, EventArgs e) => { clickable.Enabled = cmd.CanExecute(null); }; clickable.Click += (object sender, EventArgs e) => { if (cmd.CanExecute(null)) { cmd.Execute(null); } }; }