public void Execute(ActionExecutionContext context) { try { if (DestinationSeriesFolder == null) { AcceptedFileAction = VideoArchiveAction.NoAction; } if (AcceptedFileAction == VideoArchiveAction.NoAction) { Completed(this, new ResultCompletionEventArgs()); return; } Task.Factory.StartNew((state) => { State op = state as State; if (op.AcceptedFileAction == VideoArchiveAction.TransferCopy) { BaseFile.CopyTo(op.DestinationSeriesFolder); } else { BaseFile.MoveTo(op.DestinationSeriesFolder); } Completed(this, new ResultCompletionEventArgs()); }, new State { AcceptedFileAction = AcceptedFileAction, DestinationSeriesFolder = DestinationSeriesFolder }); DesiredFileAction = VideoArchiveAction.NoAction; } catch (Exception e) { Completed(this, new ResultCompletionEventArgs { Error = e }); } }