Пример #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();
                }
            }
        }
Пример #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();
                }
            }
        }