Exemple #1
0
 private static void writeDumpListFile(NotebookStats notebook, string dumpListFilePath)
 {
     List<PageInfo> pageInfos = notebook.GetPageInfo();
     using (FileStream stream = new FileStream(dumpListFilePath, FileMode.Create, FileAccess.Write, FileShare.None))
     {
         writeAsCsv(pageInfos, "\t", stream);
     }
 }
Exemple #2
0
        private static void writeDumpListFile(NotebookStats notebook, string dumpListFilePath)
        {
            List <PageInfo> pageInfos = notebook.GetPageInfo();

            using (FileStream stream = new FileStream(dumpListFilePath, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                writeAsCsv(pageInfos, "\t", stream);
            }
        }
Exemple #3
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            if (args.Length < 1)
            {
                showUsage();
                return;
            }
            string notebookNickName = args[0];
            string dumpListFilePath;

            if (args.Length >= 2)
            {
                dumpListFilePath = Path.GetFullPath(args[1]);
            }
            else
            {
                dumpListFilePath = Path.GetFullPath(notebookNickName + @".tsv");
            }

            if (!Directory.Exists(Path.GetDirectoryName(dumpListFilePath)))
            {
                Console.Error.WriteLine(@"Could not find the parent folder path ""{0}"".", dumpListFilePath);
                return;
            }
            if (Directory.Exists(dumpListFilePath))
            {
                Console.Error.WriteLine(@"""{0}"" is exists as directory.", dumpListFilePath);
                return;
            }
            if (File.Exists(dumpListFilePath))
            {
                Console.Error.WriteLine(@"""{0}"" is exists.", dumpListFilePath);
                return;
            }

            NotebookStats notebook = new NotebookStats(notebookNickName);

            Console.WriteLine(@"Notebook    : {0}", notebookNickName);
            Console.WriteLine(@"SectionGroup: {0}", notebook.SectionGroupCount);
            Console.WriteLine(@"Section     : {0}", notebook.SectionCount);
            Console.WriteLine(@"Page        : {0}", notebook.PageCount);
            Console.WriteLine(@"DumpListFile: {0}", dumpListFilePath);

            writeDumpListFile(notebook, dumpListFilePath);
        }
Exemple #4
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            if (args.Length < 1)
            {
                showUsage();
                return;
            }
            string notebookNickName = args[0];
            string dumpListFilePath;
            if (args.Length >= 2)
            {
                dumpListFilePath = Path.GetFullPath(args[1]);
            }
            else
            {
                dumpListFilePath = Path.GetFullPath(notebookNickName + @".tsv");
            }

            if (!Directory.Exists(Path.GetDirectoryName(dumpListFilePath)))
            {
                Console.Error.WriteLine(@"Could not find the parent folder path ""{0}"".", dumpListFilePath);
                return;
            }
            if (Directory.Exists(dumpListFilePath))
            {
                Console.Error.WriteLine(@"""{0}"" is exists as directory.", dumpListFilePath);
                return;
            }
            if (File.Exists(dumpListFilePath))
            {
                Console.Error.WriteLine(@"""{0}"" is exists.", dumpListFilePath);
                return;
            }

            NotebookStats notebook = new NotebookStats(notebookNickName);

            Console.WriteLine(@"Notebook    : {0}", notebookNickName);
            Console.WriteLine(@"SectionGroup: {0}", notebook.SectionGroupCount);
            Console.WriteLine(@"Section     : {0}", notebook.SectionCount);
            Console.WriteLine(@"Page        : {0}", notebook.PageCount);
            Console.WriteLine(@"DumpListFile: {0}", dumpListFilePath);

            writeDumpListFile(notebook, dumpListFilePath);
        }