상속: IABCLoadInterceptor
예제 #1
0
파일: CLI.cs 프로젝트: WeeWorld/Swiffotron
        /// <summary>
        /// App entry point
        /// </summary>
        /// <param name="args">Command line arguments</param>
        public static void Main(string[] args)
        {
            try
            {
                string config;
                string explode;

                string job = ParseArguments(args, out config, out explode);
                if (job == null && explode == null)
                {
                    PrintUsage();
                    Environment.Exit(-1);
                }

                if (explode != null)
                {
                    FileInfo swfFile = new FileInfo(explode);
                    using (FileStream swfIn = new FileStream(explode, FileMode.Open, FileAccess.Read))
                    {
                        ABCCatcher catcher = new ABCCatcher();
                        SWFReader reader = new SWFReader(swfIn, new SWFReaderOptions(), null, catcher);
                        reader.ReadSWF(new SWFContext(explode));
                        catcher.SaveAll(explode, swfFile.DirectoryName);
                    }
                }

                Swiffotron swiffotron;
                if (config == null)
                {
                    swiffotron = new Swiffotron(null);
                }
                else
                {
                    using (FileStream cfs = new FileStream(config, FileMode.Open, FileAccess.Read))
                    {
                        swiffotron = new Swiffotron(cfs);
                    }
                }

                if (job != null)
                {
                    using (FileStream jobfs = new FileStream(job, FileMode.Open, FileAccess.Read))
                    {
                        swiffotron.Process(jobfs);
                    }
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }
        }
예제 #2
0
        /// <summary>
        /// App entry point
        /// </summary>
        /// <param name="args">Command line arguments</param>
        public static void Main(string[] args)
        {
            try
            {
                string config;
                string explode;

                string job = ParseArguments(args, out config, out explode);
                if (job == null && explode == null)
                {
                    PrintUsage();
                    Environment.Exit(-1);
                }

                if (explode != null)
                {
                    FileInfo swfFile = new FileInfo(explode);
                    using (FileStream swfIn = new FileStream(explode, FileMode.Open, FileAccess.Read))
                    {
                        ABCCatcher catcher = new ABCCatcher();
                        SWFReader  reader  = new SWFReader(swfIn, new SWFReaderOptions(), null, catcher);
                        reader.ReadSWF(new SWFContext(explode));
                        catcher.SaveAll(explode, swfFile.DirectoryName);
                    }
                }

                Swiffotron swiffotron;
                if (config == null)
                {
                    swiffotron = new Swiffotron(null);
                }
                else
                {
                    using (FileStream cfs = new FileStream(config, FileMode.Open, FileAccess.Read))
                    {
                        swiffotron = new Swiffotron(cfs);
                    }
                }

                if (job != null)
                {
                    using (FileStream jobfs = new FileStream(job, FileMode.Open, FileAccess.Read))
                    {
                        swiffotron.Process(jobfs);
                    }
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.ToString());
            }
        }