예제 #1
0
        public void InfoSomeFiles()
        {
            Directory.SetCurrentDirectory(TestSrc + "SomeFiles");
            SongInfo sl = new SongInfo(DefaultTestFileName);
            sl.Close();

            StreamReader ExpectedResult = new StreamReader("expected_" + DefaultTestFileName);
            StreamReader ActualResult = new StreamReader(DefaultTestFileName);

            CommonTest.CompareResult(ExpectedResult, ActualResult);

            Directory.SetCurrentDirectory(BackTo);
        }
예제 #2
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("XMLDirectory, v"+VERSION+"\n");

            ArgumentProcessor ap = new ArgumentProcessor(args);
            ArgumentProcessor.XMLDirCommand command = ap.Command;
            String outputFile = ap.OutputFile;

            if (ap.ShowHelp)
            {
                ShowHelp();
                return;
            }

            try
            {
                SongBase sb = null;
                if (command == ArgumentProcessor.XMLDirCommand.SongList)
                {
                    SongList sl = new SongList(outputFile, ap.UseObsfucatedPdfSuffix);
                    sl.Close();
                    sb = sl;
                }
                else if (command == ArgumentProcessor.XMLDirCommand.SongInfo)
                {
                    SongInfo si = new SongInfo(outputFile);
                    si.Close();
                    sb= si;
                }
                if (sb != null)
                {
                    foreach (string file in sb.FilesProcessed)
                    {
                        Console.WriteLine("{0}", file);
                    }
                    Console.WriteLine("{0} files found.", sb.FilesProcessedCount.ToString());
                }
            }
            catch (UnauthorizedAccessException UAEx)
            {
                Console.WriteLine(UAEx.Message);
            }
            catch (PathTooLongException PathEx)
            {
                Console.WriteLine(PathEx.Message);
            }

            System.Console.WriteLine("Finished");
        }