void btn_Click(object sender, EventArgs e) { if (command == null) { var ex = new InvalidOperationException("command is null"); log.Error(ex.Message); throw ex; } Prizm.Main.Forms.IUserNotify notify = Program.Kernel.Get <Prizm.Main.Forms.IUserNotify>(); try { Program.MainForm.Enabled = false; notify.ShowProcessing(); command.Execute(); } finally { notify.HideProcessing(); Program.MainForm.Enabled = true; if (RefreshControlsState != null) { RefreshControlsState(); } } }
void check_Modified(object sender, EventArgs e) { if (command == null) { var ex = new InvalidOperationException("command is null"); log.Error(ex.Message); throw ex; } Prizm.Main.Forms.IUserNotify notify = Program.Kernel.Get <Prizm.Main.Forms.IUserNotify>(); try { notify.ShowProcessing(); command.Execute(); } finally { notify.HideProcessing(); } }
public CommandInfo Execute() { if (executor == null) { var e = new InvalidOperationException("executor is null"); log.Error(e.Message); throw e; } if (executor.CanExecute()) { Prizm.Main.Forms.IUserNotify notify = Program.Kernel.Get <Prizm.Main.Forms.IUserNotify>(); try { notify.ShowProcessing(); executor.Execute(); } finally { notify.HideProcessing(); } } return(this); }