protected override object OnExecute(IExecutionContext ctx, params object[] parms) { var isSim = ctx.InSimulationMode; _where.Initialize(ctx); var files = GetFilesToDelete(ctx); var filesDeleted = 0; var delete = isSim ? (Action <IExecutionContext, string>)SimulateDeleteFile : DeleteFile; foreach (var file in files) { delete(ctx, file); filesDeleted++; } return(filesDeleted); }