Ejemplo n.º 1
0
        private void btn_OpenJson_Click(object sender, EventArgs e)
        {
            MachineProfile current = MachineProfile.GetByName(cb_Profile.SelectedItem.ToString());

            ofd_OpenJson.InitialDirectory = current.ProfileRoot;
            if (ofd_OpenJson.ShowDialog() == DialogResult.OK)
            {
                JsonViewerForm.CreateFromFile(ofd_OpenJson.FileName).ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void btn_Run_Click(object sender, EventArgs e)
        {
            string item = cb_Profile.SelectedItem.ToString();

            Machine m = Machine.Create(MachineProfile.GetByName(item));

            MachineInstance instance = m.CreateInstance();

            MachineInstanceControl instanceControl = new MachineInstanceControl(instance);

            instanceControl.Show();
        }
Ejemplo n.º 3
0
        private void btnRunWithBios_Click(object sender, EventArgs e)
        {
            string item = cb_Profile.SelectedItem.ToString();

            MachineProfile p = MachineProfile.GetByName(item);

            if (ofdBios.ShowDialog() == DialogResult.OK)
            {
                p.BiosPath = ofdBios.FileName;
                Machine m = Machine.Create(p);

                MachineInstance instance = m.CreateInstance();

                MachineInstanceControl instanceControl = new MachineInstanceControl(instance);
                instanceControl.Show();
            }
        }
Ejemplo n.º 4
0
        private void btn_Create_Click(object sender, EventArgs e)
        {
            string item = cb_Profile.SelectedItem.ToString();
            CreateProfileDialog diag = new CreateProfileDialog(MachineProfile.GetByName(item));

            if (diag.ShowDialog() == DialogResult.OK)
            {
                MachineProfile.Save(diag.Profile);

                MessageBox.Show(
                    "Saved: " + diag.Profile.Name,
                    "Profile Saved!",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information
                    );

                LoadProfiles();
            }
        }