コード例 #1
0
            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();
                    }
                }
            }
コード例 #2
0
            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();
                }
            }
コード例 #3
0
        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);
        }