示例#1
0
        static async Task Extract(ExtractOptions o)
        {
            var progress = o.Verbose ? consoleProgress : null;

            if (!o.Commu &&
                !o.Parameter &&
                !o.Image &&
                !o.Lyrics &&
                !o.All)
            {
                Console.Error.WriteLine("No data specified to extract. Use --help for guidelines on usage.");
                return;
            }

            using ArcFile arcFile = new ArcFile(o.Input);
            if (o.Commu)
            {
                await arcFile.ExtractCommusToXlsx(o.Output, o.Overwrite, progress);
            }
            if (o.Parameter)
            {
                await arcFile.ExtractParameterToXlsx(o.Output, o.Overwrite, progress);
            }
            if (o.Image)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractAllImages(o.Output, progress);
            }
            if (o.Lyrics)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractLyrics(o.Output, o.Overwrite, progress);
            }
            if (o.All)
            {
                if (o.Overwrite && Directory.Exists(o.Output))
                {
                    Directory.Delete(o.Output, true);
                }
                await arcFile.ExtractAllAsync(o.Output, false, progress);
            }
        }
示例#2
0
        public async Task ExtractCommus()
        {
            try
            {
                ClearStatus();
                string fileName = _getFileName.SaveGetFileName("Save As", ArcFile.RemoveArcExtension(ArcPath).Item1 + "commus.xlsx", "Excel spreadsheet (*.xlsx)|*.xlsx");
                if (fileName != null)
                {
                    await ArcFile.ExtractCommusToXlsx(fileName, true, ProgressReporter);

                    ReportMessage("Done.");
                }
            }
            catch (Exception ex)
            {
                ReportException(ex);
            }
        }
示例#3
0
 public async Task ArcFileCommuTest(string arcName, string outputXlsx)
 {
     using ArcFile arcFile = new ArcFile(arcName);
     await arcFile.ExtractCommusToXlsx(outputXlsx, true, progress);
 }