Docnet.Config.CopySourceFoldersToCopy C# (CSharp) Method

CopySourceFoldersToCopy() private method

private CopySourceFoldersToCopy ( ) : void
return void
        internal void CopySourceFoldersToCopy()
        {
            var foldersToCopy = this.SourceFoldersToCopy;
            foreach(var folder in foldersToCopy)
            {
                if(string.IsNullOrWhiteSpace(folder))
                {
                    continue;
                }
                var sourceFolderName = Path.Combine(this.Source, folder);
                if(!Directory.Exists(sourceFolderName))
                {
                    continue;
                }
                var destinationFolderName = Path.Combine(this.Destination, folder);
                Console.WriteLine("... copying '{0}' to {1}", sourceFolderName, destinationFolderName);
                Utils.DirectoryCopy(sourceFolderName, destinationFolderName, copySubFolders:true);
            }
        }

Usage Example

Beispiel #1
0
 /// <summary>
 /// Generates the pages from the md files in the source, using the page template loaded and the loaded config.
 /// </summary>
 /// <returns>true if everything went ok, false otherwise</returns>
 private void GeneratePages()
 {
     if (_input.ClearDestinationFolder)
     {
         Console.WriteLine("Clearing destination folder '{0}'", _loadedConfig.Destination);
         _loadedConfig.ClearDestinationFolder();
     }
     Console.WriteLine("Copying theme '{0}'", _loadedConfig.ThemeName);
     _loadedConfig.CopyThemeToDestination();
     Console.WriteLine("Copying source folders to copy.");
     _loadedConfig.CopySourceFoldersToCopy();
     Console.WriteLine("Generating pages in '{0}'", _loadedConfig.Destination);
     _loadedConfig.Pages.GenerateOutput(_loadedConfig, new NavigatedPath());
     Console.WriteLine("Generating search index");
     _loadedConfig.GenerateSearchData();
     Console.WriteLine("Done!");
 }