Exemple #1
0
        public Form OpenFile(byte[] File, string name)
        {
            BinaryDataReader bin   = new BinaryDataReader(new MemoryStream(File));
            string           Magic = bin.ReadString(4);

            if (Magic == "Yaz0")
            {
                return(OpenFile(ManagedYaz0.Decompress(File), name));
            }
            else if (Magic == "SARC")
            {
                var f = new EditorForms.SzsEditor(SARCExt.SARC.UnpackRamN(File), this);
                f.Text = name;
                OpenForm(f);
                return(f);
            }
            else if (Magic == "FLYT")
            {
                EditorView editorView = new EditorView(new BflytFile(File));
                editorView.Text = name;
                OpenForm(editorView);
                return(editorView);
            }
            else if (Magic == "FLAN")
            {
                var editor = new BflanEditor(new BflanFile(File));
                OpenForm(editor);
                return(editor);
            }
            return(null);
        }
Exemple #2
0
        public Form OpenFile(byte[] File, IFileWriter saveTo)
        {
            string Magic  = Encoding.ASCII.GetString(File, 0, 4);
            Form   result = null;

            if (Magic == "Yaz0")
            {
                return(OpenFile(ManagedYaz0.Decompress(File), saveTo));
            }
            else if (Magic == "SARC")
            {
                result = new EditorForms.SzsEditor(SARCExt.SARC.Unpack(File), saveTo, this);
            }
            else if (Magic == "FLYT")
            {
                result = new EditorView(new BflytFile(File), saveTo);
            }
            else if (Magic == "FLAN")
            {
                result = new BflanEditor(new BflanFile(File), saveTo);
            }

            if (result != null)
            {
                OpenForm(result);
            }

            return(result);
        }
Exemple #3
0
 public SzsFileProvider(SzsEditor parent, string path) =>
 (Parent, Path) = (parent, path);