/// ------------------------------------------------------------------------------------ protected override IEnumerable <KeyValuePair <string, string> > GetFilesToCopy(IEnumerable <string> validComponentFilesToCopy) { if (GetCompletedStages(true).Any(s => s.Id == ComponentRole.kSourceComponentRoleId)) { foreach (var kvp in base.GetFilesToCopy(validComponentFilesToCopy)) { yield return(kvp); } } else { var sourceRole = ComponentRoles.First(r => r.Id == ComponentRole.kSourceComponentRoleId); bool foundSourceFile = false; foreach (var srcFile in validComponentFilesToCopy) { var destFile = (foundSourceFile || !sourceRole.IsPotential(srcFile)) ? GetDestinationFilename(srcFile) : Path.Combine(FolderPath, sourceRole.GetCanoncialName(Path.GetFileNameWithoutExtension(srcFile), Path.GetFileName(srcFile))); if (!File.Exists(destFile)) { yield return(new KeyValuePair <string, string>(srcFile, destFile)); foundSourceFile = true; } } } }
/// ------------------------------------------------------------------------------------ public override IEnumerable <ComponentRole> GetCompletedStages( bool modifyComputedListWithUserOverrides) { var list = base.GetCompletedStages(modifyComputedListWithUserOverrides).ToList(); if (GetShouldReportHaveConsent()) { list.Insert(0, ComponentRoles.First(r => r.Id == ComponentRole.kConsentComponentRoleId)); } return(modifyComputedListWithUserOverrides ? GetCompletedStagesModifedByUserOverrides(list) : list); }