private void MainControl_Load(object sender, EventArgs e) { if (!MachineProfile.Exists("Default")) { CreateDefaultProfile(); } LoadProfiles(); }
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(); } }
public MachineProfile Create(string name, string root, string bios) { MachineProfile profile = new () { BiosPath = bios, ProfileRoot = root, Name = name, StartArguments = "-cli:waitOnExit" }; string content = MachineProfile.Save(profile); MessageBox.Show( "Created Profile '" + profile.Name + "'\n" + content, "Profile Created!", MessageBoxButtons.OK, MessageBoxIcon.Information ); LoadProfiles(); return(profile); }
public static string GetDefaultBios(MachineProfile profile) => Path.Combine(profile.ProfileRoot, "bios", "bios.vbin");
public CreateProfileDialog(MachineProfile machineProfile) { Profile = machineProfile; InitializeComponent(); }