コード例 #1
0
        public void Execute(T2 parameter)
        {
            if (executeMethod != null)
            {
                executeMethod(parameter);
            }

            //now raise CommandCompleted for this ICommand
            WeakActionEvent <object> completedHandler = CommandCompleted;

            if (completedHandler != null)
            {
                completedHandler.Invoke(parameter);
            }
        }
コード例 #2
0
ファイル: SimpleCommand.cs プロジェクト: guigui43/TDV2
 public SimpleCommand(Action <T2> executeMethod)
 {
     _executeMethod    = executeMethod;
     _canExecuteMethod = x => { return(true); };
     CommandCompleted  = new WeakActionEvent <object>();
 }
コード例 #3
0
 public CommandHandler(Action <T2> executeMethod)
 {
     this.executeMethod    = executeMethod;
     this.canExecuteMethod = (x) => { return(true); };
     this.CommandCompleted = new WeakActionEvent <object>();
 }
コード例 #4
0
ファイル: SimpleCommand.cs プロジェクト: guigui43/TDV2
 public SimpleCommand(Func <T1, bool> canExecuteMethod, Action <T2> executeMethod)
 {
     _executeMethod    = executeMethod;
     _canExecuteMethod = canExecuteMethod;
     CommandCompleted  = new WeakActionEvent <object>();
 }
コード例 #5
0
 public CommandHandler(Func <T1, bool> canExecuteMethod, Action <T2> executeMethod)
 {
     this.executeMethod    = executeMethod;
     this.canExecuteMethod = canExecuteMethod;
     this.CommandCompleted = new WeakActionEvent <object>();
 }