private void button2_Click(object sender, EventArgs e) { #region TYPE_OF_GPU var Cheaking_gpu = groupBox5.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); listBox2.Items.Insert(0, "Тип видеокарты: " + Cheaking_gpu.Text); _settings.GPU = (string)listBox2.Items[0]; #endregion #region GPU if (type_of_gpu.Items.Count < 1) { listBox2.Items.Clear(); listBox2.Items.Add("Вы забыли указать наименование видеокарты ("); } else { listBox2.Items.Insert(1, "Наименование видеокарты: " + type_of_gpu.Text); _settings.GPU_Brand = (string)listBox2.Items[1]; } #endregion #region AMOUNT listBox2.Items.Insert(2, "Количество видеопамяти: " + amountgpu.Text + " ГБ"); _settings.GPU_Memory = (string)listBox2.Items[2]; _settings.Save("gpu.xml"); #endregion }
private void Event_Click(object sender, EventArgs e) { listBox1.Items.Clear(); #region TYPE_OF_EVM var Cheaking_item = type_of_item.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); listBox1.Items.Insert(0, "Тип ЭВМ: " + Cheaking_item.Text); Evm = (string)listBox1.Items[0]; #endregion #region TYPE_OF_CPU var Cheaking_cpu = groupBox2.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); listBox1.Items.Insert(1, "Тип Процессора: " + Cheaking_cpu.Text); CPU = (string)listBox1.Items[1]; #endregion #region CPU if (type_of_cpu.Items.Count < 1) { listBox1.Items.Clear(); listBox1.Items.Add("Вы забыли указать наименование процессора ("); } else { listBox1.Items.Insert(2, "Наименование процессора: " + type_of_cpu.Text); CPU_Name = (string)listBox1.Items[2]; } #endregion #region AMOUNTRAM listBox1.Items.Insert(3, "Количество памяти ОЗУ: " + amountram.Value + " ГБ"); RAM = (string)listBox1.Items[3]; #endregion #region Type_of_rom var Cheaking_rom = groupBox1.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked); listBox1.Items.Insert(4, "Тип ПЗУ: " + Cheaking_rom.Text); RAM_Type = (string)listBox1.Items[4]; #endregion #region AMOUNTROM listBox1.Items.Insert(5, "Количество памяти: " + trackBar1.Value + " ГБ"); ROM = (string)listBox1.Items[5]; #endregion #region OS for (int i = 0; i < type_of_os.CheckedItems.Count; i++) { listBox1.Items.Insert(6 + i, "Выбранная предустановленная ОС" + type_of_os.CheckedItems[i].ToString()); } OS = (string)listBox1.Items[6]; #endregion _saving.Save("buf.xml", ); }