示例#1
0
        private void OpenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var ofd = new OpenFileDialog();

            if (ofd.ShowDialog() == DialogResult.OK)
            {
                filepath = ofd.FileName;

                using (var fs = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read))
                {
                    var data = MKAFileConverter.DeserializeFromStream(fs);

                    tbox_appname.Enabled = true;
                    tbox_descr.Enabled   = true;
                    btn_new.Enabled      = true;

                    builder           = new MKAFileDataBuilder(data);
                    tbox_appname.Text = data.ApplicationName;
                    tbox_descr.Text   = data.Description;

                    tview_objects.Nodes.Clear();
                    foreach (var d in data.Objects)
                    {
                        tview_objects.Nodes.Add(d.Key);
                    }
                }
            }

            ofd.Dispose();
        }
示例#2
0
        private void NewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tbox_appname.Enabled = true;
            tbox_descr.Enabled   = true;
            btn_new.Enabled      = true;

            string aname = "mkafile Editor";

            builder           = new MKAFileDataBuilder(aname);
            tbox_appname.Text = aname;
            tbox_descr.Text   = "NO INFORMATION";

            tview_objects.Nodes.Clear();
        }