public static Dumper CreateHtmlGenerater(string bzipPath, bool isJapanese, DirectoryInfoCache result, PerfCounter counter)
 {
     DumpAction htmlAction = DumpAction.CreateHtmlGeneraterAction(bzipPath, result.Item);
     var dumper = new Dumper(bzipPath, htmlAction, counter);
     SplitFolder sf = CreateSplitFolder(isJapanese, result);
     PostCreate(dumper, isJapanese, sf);
     return dumper;
 }
        public static Dumper CreateHtmlGenerater(string bzipPath, bool isJapanese, DirectoryInfoCache result, PerfCounter counter)
        {
            DumpAction  htmlAction = DumpAction.CreateHtmlGeneraterAction(bzipPath, result.Item);
            var         dumper     = new Dumper(bzipPath, htmlAction, counter);
            SplitFolder sf         = CreateSplitFolder(isJapanese, result);

            PostCreate(dumper, isJapanese, sf);
            return(dumper);
        }
 public static Dumper CreateRawDumper(string bzipPath, bool isJapanese, DirectoryInfoCache result, PerfCounter counter)
 {
     DumpAction rawDump = DumpAction.CreateRawDumpAction(bzipPath, result.Item);
     Dumper dumper =  new Dumper(bzipPath, rawDump, counter);
     SplitFolder sf = CreateSplitFolder(isJapanese, result);
     // not DRY!
     sf.InterestedFilePattern = "*.wiki";
     PostCreate(dumper, isJapanese, sf);
     return dumper;
 }
        public static Dumper CreateRawDumper(string bzipPath, bool isJapanese, DirectoryInfoCache result, PerfCounter counter)
        {
            DumpAction  rawDump = DumpAction.CreateRawDumpAction(bzipPath, result.Item);
            Dumper      dumper  = new Dumper(bzipPath, rawDump, counter);
            SplitFolder sf      = CreateSplitFolder(isJapanese, result);

            // not DRY!
            sf.InterestedFilePattern = "*.wiki";
            PostCreate(dumper, isJapanese, sf);
            return(dumper);
        }
        private static void PostCreate(Dumper dumper, bool isJapanese, SplitFolder sf)
        {
            dumper._bzipReader.EnableYomi = isJapanese;
            dumper.SetSplitFolder(sf, Properties.Settings.Default.StartSplitLimit);
            // for debug

            /*
             * sf.MaxFileNum = 2;
             * dumper.SetSplitFolder(sf, 10);
             * */
        }
Exemple #6
0
        private void DumpFileToArchive(string[] files, Action <IEnumerable <FileInfo>, string> archive, Func <string, bool, DirectoryInfoCache, PerfCounter, Dumper> createDumper, DirectoryInfoCache workingDir, string outputExtension, string sourceExtension)
        {
            if (EnableAutoLogging)
            {
                // use parent of pdf/epub folder.
                _counter.SetOutputFolder(workingDir.Item.Parent.FullName);
            }

            using (var uwAll = _counter.UsingWatch("All"))
            {
                foreach (string file in files)
                {
                    bool   isJapanese = IsJapanese(file);
                    Dumper gen        = createDumper(file, isJapanese, workingDir, _counter);
                    gen.EnableAutoLogging = EnableAutoLogging;
                    if (DialogResult.OK != new ProgressDialog(gen.LongTask, _counter).ShowDialog(this))
                    {
                        // MessageBox.Show("generate html cancelled");
                        // tmp fall through.
                        // return;
                    }
                }

                using (var uwArchive = _counter.UsingWatch("Archive"))
                {
                    ArchiveTask archiveTask = new ArchiveTask(workingDir, archive, outputExtension);
                    archiveTask.SourceExtension = sourceExtension;
                    if (DialogResult.OK != new ProgressDialog(archiveTask, _counter).ShowDialog(this))
                    {
                        MessageBox.Show("generate epub cancelled");
                        return;
                    }
                }
            }
            if (EnableAutoLogging)
            {
                _counter.DumpToLog();
            }
        }
Exemple #7
0
 private static void SetupParameterForBenchMark(Dumper dumper)
 {
     dumper._bzipReader.SplitFolder.MaxFileNum = 2;
     dumper._bzipReader.StartSplitLimit = 10;
 }
 private static void PostCreate(Dumper dumper, bool isJapanese, SplitFolder sf)
 {
     dumper._bzipReader.EnableYomi = isJapanese;
     dumper.SetSplitFolder(sf, Properties.Settings.Default.StartSplitLimit);
     // for debug
     /*
     sf.MaxFileNum = 2;
     dumper.SetSplitFolder(sf, 10);
      * */
 }