예제 #1
0
 public void Consume(BlockNode anotherBlock)
 {
     foreach (var child in anotherBlock.Children)
     {
         Children.Add(child);
     }
     foreach (var postExec in anotherBlock.PostExecution)
     {
         PostExecution.Add(postExec);
     }
 }
예제 #2
0
        public void Execute(
            object parameter)
        {
            PreExecution?.Invoke(
                this,
                new RelayCommandEventArgs(parameter));

            var p = parameter is T
                ? (T)parameter
                : (T)Convert.ChangeType(
                parameter,
                typeof(T));

            _execute(
                p);

            PostExecution?.Invoke(
                this,
                new RelayCommandEventArgs(parameter));
        }
 /// <summary>
 /// Defines the method to be called when the command is invoked.
 /// </summary>
 /// <param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
 /// <exception cref="Exception"><see cref="PreExecution"/>'s, <see cref="PostExecution"/>'s or <see cref="execute"/>'s callback throws an exception.</exception>
 public void Execute(object parameter)
 {
     PreExecution?.Invoke(this, new DataEventArgs <object>(parameter));
     execute(ConversionHelper.ConvertValue <T>(parameter));
     PostExecution?.Invoke(this, new DataEventArgs <object>(parameter));
 }
예제 #4
0
 /// <summary>
 /// Defines the method to be called when the command is invoked.
 /// </summary>
 /// <param name="parameter">data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
 /// <exception cref="Exception"><see cref="PreExecution"/>'s, <see cref="PostExecution"/>'s or <see cref="execute"/>'s callback throws an exception.</exception>
 public void Execute(object parameter)
 {
     PreExecution?.Invoke(this, new DataEventArgs <object>(parameter));
     execute(parameter);
     PostExecution?.Invoke(this, new DataEventArgs <object>(parameter));
 }
예제 #5
0
 private void PostExecute()
 {
     PostExecution?.Invoke(this, new ExecuteTaskEventArgs {
         IsExecuting = _watcher.IsNotCompleted, IsSuccess = _watcher.IsSuccessfullyCompleted, Exception = _watcher.Exception
     });
 }