示例#1
0
 private void BindCommands(CommandExecutor commandExecutor)
 {
     this.View.CreateDatabase += (s, e) => commandExecutor.ExecuteCommand(new CreateDatabaseCommand());
     this.View.DeleteDatabase += (s, e) => commandExecutor.ExecuteCommand(new DeleteDatabaseCommand());
     this.View.EnableAllJobs += (s, e) => commandExecutor.ExecuteCommand(new EnableAllJobsCommand());
     this.View.DisableAllJobs += (s, e) => commandExecutor.ExecuteCommand(new DisableAllJobsCommand());
 }
示例#2
0
        public ManagerPresenter(IManagerView view, CommandExecutor commandExecutor)
        {
            if (view==null)
            {
                throw new ArgumentNullException("view");
            }

            if (commandExecutor == null)
            {
                throw new ArgumentNullException("commandExecutor");
            }

            this.View = view;

            BindCommands(commandExecutor);
        }