Example #1
0
        private void loadecbToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "EcBinaryFile (*.ecb)|*.ecb";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                using (var fs = new FileStream(dlg.FileName, FileMode.OpenOrCreate))
                {
                    EcFileFormat ecf = new EcFileFormat();

                    Reader.Load(fs, ref ecf);
                    fastColoredTextBox1.Text = ecf.Filesystem.GetFile <string>("main.ec");
                    fs.Close();
                }
            }
        }
Example #2
0
        private void buildEcRuntimeFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "EcBinaryFile (*.ecb)|*.ecb";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                EcFileFormat eff = new EcFileFormat();
                eff.Filesystem.AddFile("main.ec", fastColoredTextBox1.Text);
                eff.Version = "A 1.0.4";

                using (var fs = new FileStream(dlg.FileName, FileMode.OpenOrCreate))
                {
                    Writer.Save(fs, eff);

                    fs.Close();
                }
            }
        }
Example #3
0
        public static void Load(Stream strm, ref EcFileFormat ecf)
        {
            var br = new BinaryReader(new GZipStream(strm, CompressionMode.Decompress));
            ecf.Version = br.ReadString();

            var depC = br.ReadInt32();

            ecf.Filesystem.Read(br);
            ecf.Resources.Read(br);

            for (int i = 0; i < depC; i++)
            {
                var bC = br.ReadInt32();

                ecf.Dependencies.Add(br.ReadBytes(bC));
            }

            br.Close();
        }
Example #4
0
        public static void Load(Stream strm, ref EcFileFormat ecf)
        {
            var br = new BinaryReader(new GZipStream(strm, CompressionMode.Decompress));

            ecf.Version = br.ReadString();

            var depC = br.ReadInt32();

            ecf.Filesystem.Read(br);
            ecf.Resources.Read(br);

            for (int i = 0; i < depC; i++)
            {
                var bC = br.ReadInt32();

                ecf.Dependencies.Add(br.ReadBytes(bC));
            }

            br.Close();
        }
Example #5
0
        public static void Save(Stream strm, EcFileFormat efFormat)
        {
            var bw = new BinaryWriter(new GZipStream(strm, CompressionMode.Compress));

            bw.Write(efFormat.Version);
            bw.Write(efFormat.Dependencies.Count);

            bw.Flush();

            efFormat.Filesystem.Write(bw);
            efFormat.Resources.Write(bw);

            bw.Flush();

            foreach (var dep in efFormat.Dependencies)
            {
                bw.Write(dep.Length);
                bw.Write(dep);
            }

            bw.Flush();
            bw.Close();
        }
Example #6
0
        public static void Save(Stream strm, EcFileFormat efFormat)
        {
            var bw = new BinaryWriter(new GZipStream(strm, CompressionMode.Compress));

            bw.Write(efFormat.Version);
            bw.Write(efFormat.Dependencies.Count);

            bw.Flush();

            efFormat.Filesystem.Write(bw);
            efFormat.Resources.Write(bw);

            bw.Flush();

            foreach (var dep in efFormat.Dependencies)
            {
                bw.Write(dep.Length);
                bw.Write(dep);
            }


            bw.Flush();
            bw.Close();
        }