示例#1
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();
            }
        }
示例#2
0
        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);
        }