コード例 #1
0
ファイル: UICommand.cs プロジェクト: Ratatui/Lecon
        public virtual void Execute(object parameter)
        {
            UICommandExecutingEventArgs args = new UICommandExecutingEventArgs(parameter);
            this.OnExecuting(args);

            if (!this.Handled)
            {
                parameter = args.Parameter;

                if (this.action != null)
                    this.action();
                if (this.actionWithParameter != null)
                    this.actionWithParameter(parameter);

                this.OnExecuted(parameter);
            }
            else
                this.Handled = false;
        }
コード例 #2
0
ファイル: UICommand.cs プロジェクト: Ratatui/Lecon
 protected void OnExecuting(UICommandExecutingEventArgs args)
 {
     EventHandler<UICommandExecutingEventArgs> handler = this.Executing;
     if (handler != null)
     {
         handler(this, args);
     }
 }