Docnet.Config.ClearDestinationFolder C# (CSharp) Method

ClearDestinationFolder() private method

private ClearDestinationFolder ( ) : void
return void
        internal void ClearDestinationFolder()
        {
            if(string.IsNullOrWhiteSpace(this.Destination))
            {
                Console.WriteLine("[WARNING] Destination is empty. No folder to clear.");
                return;
            }
            if(!Directory.Exists(this.Destination))
            {
                return;
            }
            Directory.Delete(this.Destination, true);
            Directory.CreateDirectory(this.Destination);
        }

Usage Example

コード例 #1
0
ファイル: Engine.cs プロジェクト: qidouhai/DocNet
 /// <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!");
 }