private void btnSave_Click(object sender, EventArgs e) { var processor = new Processor(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbCoresNum.Text), double.Parse(tbFrequency.Text), int.Parse(tbProcessTechnology.Text), int.Parse(tbCacheSize.Text), int.Parse(tbThermalDesignPower.Text)); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(processor); this.Close(); }
private void UpdateItemList() { lbItems.Items.Clear(); foreach (Item item in ListItemStorage.GetInstance().GetItemList()) { lbItems.Items.Add(item.Name); } }
private void btnSave_Click(object sender, EventArgs e) { var powerSupply = new PowerSupply(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbEfficiency.Text), int.Parse(tbPower.Text)); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(powerSupply); this.Close(); }
private void btnSave_Click(object sender, EventArgs e) { var systemCase = new SystemCase(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbFansAmount.Text), int.Parse(tbUSBPorts.Text)); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(systemCase); this.Close(); }
private void btnSave_Click(object sender, EventArgs e) { var memory = new RAM(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbFrequency.Text), int.Parse(tbCapacity.Text), tbType.Text); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(memory); this.Close(); }
private void btnSave_Click(object sender, EventArgs e) { var hardDrive = new HardDrive(tbName.Text, int.Parse(tbPrice.Text), tbCompany.Text, int.Parse(tbAmount.Text), int.Parse(tbCapacity.Text), int.Parse(tbRotateSpeed.Text), tbConnectionInterface.Text); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(hardDrive); this.Close(); }
private void btnSave_Click(object sender, EventArgs e) { var motherboard = new Motherboard(tbName.Text, int.Parse(tbPrice.Text), tbCompanyName.Text, int.Parse(tbAmount.Text), tbCPUSupport.Text, tbSocket.Text, tbFormFactor.Text); IStorage storage = ListItemStorage.GetInstance(); storage.AddItem(motherboard); this.Close(); }
private void btnDelete_Click(object sender, EventArgs e) { if (lbItems.SelectedIndex != -1) { ListItemStorage.GetInstance().DeleteItem(lbItems.SelectedItem.ToString()); } else { MessageBox.Show("Please, choose item, which you want to delete!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadData(string name) { var item = (PowerSupply)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompany.Text = item.Amount.ToString(); tbAmount.Text = item.Amount.ToString(); tbEfficiency.Text = item.Efficiency.ToString(); tbPower.Text = item.Power.ToString(); }
private void LoadData(string name) { var item = (SystemCase)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompany.Text = item.CompanyName.ToString(); tbAmount.Text = item.Amount.ToString(); tbFansAmount.Text = item.FansAmount.ToString(); tbUSBPorts.Text = item.USBPortAmount.ToString(); }
private void LoadData(string name) { var item = (RAM)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompany.Text = item.Amount.ToString(); tbAmount.Text = item.Amount.ToString(); tbFrequency.Text = item.Frequency.ToString(); tbCapacity.Text = item.Capacity.ToString(); tbType.Text = item.Type.ToString(); }
private void LoadData(string name) { var item = (HardDrive)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompany.Text = item.Amount.ToString(); tbAmount.Text = item.Amount.ToString(); tbCapacity.Text = item.Capacity.ToString(); tbRotateSpeed.Text = item.RotateSpeed.ToString(); tbConnectionInterface.Text = item.ConnectionInterface.ToString(); }
private void LoadData(string name) { var item = (Motherboard)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompanyName.Text = item.Amount.ToString(); tbAmount.Text = item.Amount.ToString(); tbCPUSupport.Text = item.CPUSupport.ToString(); tbSocket.Text = item.Socket.ToString(); tbFormFactor.Text = item.FormFactor.ToString(); }
public fMain() { InitializeComponent(); InitializeData(); action = UpdateItemList; listItemStorage = ListItemStorage.GetInstance(); listItemStorage.SubscribeUIUpdate(action); pluginManager = new PluginManager(); serializers = pluginManager.SerializerPlugins; zipAlgorithms = pluginManager.ZipPlugins; UpdateSerializationTypes(serializers); UpdateZipAlgorithms(zipAlgorithms); }
private void LoadData(string name) { var item = (Processor)ListItemStorage.GetInstance().GetItem(name); tbName.Text = item.Name; tbPrice.Text = item.Price.ToString(); tbCompany.Text = item.Amount.ToString(); tbAmount.Text = item.Amount.ToString(); tbCoresNum.Text = item.CoresNum.ToString(); tbFrequency.Text = item.Frequency.ToString(); tbProcessTechnology.Text = item.ProcessTechnology.ToString(); tbCacheSize.Text = item.CacheSize.ToString(); tbThermalDesignPower.Text = item.ThermalDesignPower.ToString(); }