public static ArchivingAction FromTemplate(ArchivingActionTemplate template, IFilterService filterService, string item = null) { var targetArchive = template.DueDate.HasValue && template.DueDate.Value < DateTime.Now && template.OutputArchiveAfterDueDate != null ? template.OutputArchiveAfterDueDate : template.OutputArchive; return(new ArchivingAction { ActionType = template.ActionType, RelativeSourcePath = template.InputArchive.Path, FullLocalSourcePath = template.InputArchive.FullLocalPath, FullNetworkSourcePath = template.InputArchive.FullNetworkPath, SourceArchiveName = template.InputArchive.DisplayName, RelativeTargetPath = targetArchive.Path, FullLocalTargetPath = targetArchive.FullLocalPath, FullNetworkTargetPath = targetArchive.FullNetworkPath, TargetArchiveName = targetArchive.DisplayName, Item = item, RetryCount = template.RetryCount, RetryDelay = template.RetryDelay, Filter = !string.IsNullOrWhiteSpace(template.Filter) ? filterService.CreateFilter(template.Filter) : null, HandleSynchronously = template.HandleSynchronously, IncludeInternalItems = template.IncludeInternalItems }); }
public void NewAction() { var action = new ArchivingActionTemplate(); this.Settings.ArchivingActionTemplates.Add(action); this.SelectedAction = action; }