Exemple #1
0
        internal void Generate(IDriver driver)
        {
            Files = new List<HtmlFile>();

            if (!driver.PreGenerate(this))
            {

            }

            if (!driver.Generate(this))
            {
                var inFiles = Directory.EnumerateFiles(InputDirectory, "*.*", SearchOption.AllDirectories);

                foreach (var path in inFiles)
                {
                    // If any stage returns null this file is broken and should be ignored
                    var file = new HtmlFile(Path.GetFullPath(path).Substring(Path.GetFullPath(InputDirectory).Length).Replace('\\', '/'), "", File.ReadAllText(path), "", "", null);
                    if (file != null)
                        file = ProcessStage1(file);
                    if (file != null)
                        file = ProcessStage2(file);
                    if (file != null)
                        file = ProcessStage3(file);
                    if (file != null)
                        Files.Add(file);
                }
            }

            if(!driver.PostGenerate(this))
            {

            }
        }