Example #1
0
        public ActionResult <IEnumerable <string> > Get()
        {
            var req = new TxnReq {
                SeqId = 1, Reference = "123"
            };

            _commandWrapper.Execute(req);
            _remoteWrapper.Execute(req);

            return(new string[] { "value1", "value2" });
        }
Example #2
0
        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);
                }
            };
        }
Example #3
0
        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);
                }
            };
        }