public void CopyContentTo(Project project) { var sourcePath = ContentDirectory.FullName; var destinationPath = project.ProjectDirectory.FullName; GetNewPathDelegate getNewPath = fsi => destinationPath + fsi.FullName.Substring(sourcePath.Length); // Now Create all of the directories foreach (var sourceDir in ContentDirectory.GetDirectories("*", SearchOption.AllDirectories)) Try(sourceDir, getNewPath, CreateDirectory); // Copy all the files foreach (var sourceFile in ContentDirectory.GetFiles("*.*", SearchOption.AllDirectories)) Try(sourceFile, getNewPath, File.Copy); }
public bool IsReferencedBy(Project project) { var projectPackagesConfig = project.PackagesConfig; var allPackageMatches = PackageRegex.Matches(projectPackagesConfig).OfType<Match>(); var thisPackageMatches = allPackageMatches.Where(match => match.Value("id") == Id && match.Value("version") == Version) .ToList(); return thisPackageMatches.Any(); }