Exemplo n.º 1
0
        public List <TSOFile> LoadTSOFile(string source_file)
        {
            List <TSOFile> tso_list = new List <TSOFile>();

            try
            {
                if (Path.GetExtension(source_file).ToUpper() == ".TSO")
                {
                    TSOFile tso = new TSOFile();
                    tso.Load(source_file);
                    tso_list.Add(tso);
                }
                else if (Directory.Exists(source_file))
                {
                    string[] files = Directory.GetFiles(source_file, "*.TSO");
                    foreach (string file in files)
                    {
                        TSOFile tso = new TSOFile();
                        tso.Load(file);
                        tso_list.Add(tso);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex);
            }
            return(tso_list);
        }
Exemplo n.º 2
0
        public List <TSOFigure> LoadPNGFile(string source_file)
        {
            List <TSOFigure> fig_list = new List <TSOFigure>();

            if (File.Exists(source_file))
            {
                try
                {
                    PNGFile   png = new PNGFile();
                    TSOFigure fig = null;
                    TMOFile   tmo = null;

                    png.Hsav += delegate(string type)
                    {
                        fig = new TSOFigure();
                        fig_list.Add(fig);
                    };
                    png.Lgta += delegate(Stream dest, int extract_length)
                    {
                        fig = new TSOFigure();
                        fig_list.Add(fig);
                    };
                    png.Ftmo += delegate(Stream dest, int extract_length)
                    {
                        tmo = new TMOFile();
                        tmo.Load(dest);
                        fig.Tmo = tmo;
                    };
                    png.Figu += delegate(Stream dest, int extract_length)
                    {
                    };
                    png.Ftso += delegate(Stream dest, int extract_length, byte[] opt1)
                    {
                        TSOFile tso = new TSOFile();
                        tso.Load(dest);
                        fig.TSOList.Add(tso);
                    };
                    png.Load(source_file);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex);
                }
            }
            return(fig_list);
        }
Exemplo n.º 3
0
        public List <TSOFile> LoadTSOFile(Stream source)
        {
            List <TSOFile> tso_list = new List <TSOFile>();

            try
            {
                {
                    TSOFile tso = new TSOFile();
                    tso.Load(source);
                    tso_list.Add(tso);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex);
            }
            return(tso_list);
        }