Пример #1
0
        public static void Processor(bool json)
        {
            Console.Title = "AET Converter";
            Program.Choose(1, "bin", out string[] fileNames);
            if (fileNames.Length < 1)
            {
                return;
            }

            string filepath, ext;
            KKdAet aet;

            foreach (string file in fileNames)
            {
                using (aet = new KKdAet())
                {
                    ext      = Path.GetExtension(file);
                    filepath = file.Replace(ext, "");
                    ext      = ext.ToLower();

                    Console.Title = "AET Converter: " + Path.GetFileNameWithoutExtension(file);
                    if (ext == ".bin")
                    {
                        aet.AETReader(filepath);
                        aet.MsgPackWriter(filepath, json);
                    }
                    else if (ext == ".mp" || ext == ".json")
                    {
                        aet.MsgPackReader(filepath, ext == ".json");
                        aet.AETWriter(filepath);
                    }
                }
            }
        }
Пример #2
0
        public static void Processor(bool JSON)
        {
            Console.Title = "AET Converter";
            KKdAet Aet;

            Main.Choose(1, "bin", out string[] FileNames);
            if (FileNames.Length < 1)
            {
                return;
            }
            string filepath = "";
            string ext      = "";

            foreach (string file in FileNames)
            {
                Aet      = new KKdAet();
                ext      = Path.GetExtension(file);
                filepath = file.Replace(ext, "");
                ext      = ext.ToLower();

                Console.Title = "AET Converter: " + Path.GetFileNameWithoutExtension(file);
                if (ext == ".bin")
                {
                    Aet.AETReader(filepath);
                    Aet.MsgPackWriter(filepath, JSON);
                }
                else if (ext == ".mp" || ext == ".json")
                {
                    Aet.MsgPackReader(filepath, ext == ".json");
                    Aet.AETWriter(filepath);
                }
                Aet = null;
            }
        }