Beispiel #1
0
        public static void Build(Blog b, SymbolManager symanager)
        {
            bool done = false;
               _wasCanceled = false;
               _builderThread = new Thread(() =>
               {
                    Build(b, symanager.Providers);
                    done = true;
               });

               _builderThread.Start();
               while (!done && !_wasCanceled)
                    Thread.Sleep(100);
        }
Beispiel #2
0
        private static void Build(Blog b, ISymbolProvider[] providers)
        {
            FileSystem = new VirtualFileSystem();

               Console.WriteLine("Loading posts...");
               List<Post> posts = new List<Post>(b.GetPosts());
               Console.WriteLine($"Loaded {posts.Count} posts!");

               Console.WriteLine("Loading templates...");
               List<Template> templates = new List<Template>();

               Console.WriteLine("Building posts...");

               Console.WriteLine("Loading pages...");
               List<CodeFile> pages = new List<CodeFile>();

               Console.WriteLine("Building pages...");

               Console.WriteLine("Saving...");
               FileSystem.Save(b.OutputFolder);

               Console.WriteLine("Moving resources...");
        }
Beispiel #3
0
        private static void Unload(string[] args)
        {
            if (args.Length != 0)
               {
                    IncorrectSyntax("unload");
                    return;
               }

               if (OpenBlog == null)
               {
                    Console.WriteLine("No blog loaded!");
                    return;
               }

               string dir = OpenBlog.RootDirectory;
               OpenBlog.Dispose();
               OpenBlog = null;

               Console.WriteLine($"Blog at '{dir}' released!");
        }
Beispiel #4
0
        private static void Load(string[] args)
        {
            if (args.Length != 0)
               {
                    IncorrectSyntax("load");
                    return;
               }

               if (OpenBlog != null)
               {
                    Console.WriteLine($"Already loaded blog at '{OpenBlog.RootDirectory}', use 'unload' to release it and then this command here again!");
                    return;
               }

               if (!Blog.IsBlog(_workDir))
               {
                    Console.WriteLine($"No blog created at '{_workDir}'!");
                    return;
               }

               try
               {
                    OpenBlog = new Blog(_workDir);
                    Console.WriteLine($"Loaded blog at '{_workDir}'!");
               }
               catch (Exception ex)
               {
                    Console.WriteLine($"ERROR: {ex.Message}");
               }
        }