Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programmatically fire a command

I have an ICommand that I want to fire (make the execute go) from code; how do I do this?

like image 926
Aran Mulholland Avatar asked Nov 15 '09 23:11

Aran Mulholland


2 Answers

Assuming there is someCommand with commandArgs:

if (someCommand.CanExecute(commandArgs))
{
    someCommand.Execute(commandArgs);
}
like image 78
Cameron MacFarland Avatar answered Sep 24 '22 01:09

Cameron MacFarland


Try calling the Execute method.

like image 24
SLaks Avatar answered Sep 27 '22 01:09

SLaks