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(); } }
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(); }
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(); } }
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(); } }