예제 #1
0
        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();
        }
예제 #2
0
 private void UpdateItemList()
 {
     lbItems.Items.Clear();
     foreach (Item item in ListItemStorage.GetInstance().GetItemList())
     {
         lbItems.Items.Add(item.Name);
     }
 }
예제 #3
0
        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();
        }
예제 #4
0
        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();
        }
예제 #5
0
        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();
        }
예제 #6
0
        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();
        }
예제 #7
0
        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();
        }
예제 #8
0
 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);
     }
 }
예제 #9
0
        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();
        }
예제 #10
0
        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();
        }
예제 #11
0
        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();
        }
예제 #12
0
        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();
        }
예제 #13
0
        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();
        }
예제 #14
0
 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);
 }
예제 #15
0
        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();
        }