public static void ReleaseSoftwareComponent(List <HardwareComponents> computer, string command)
        {
            var tokens = command.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries)
                         .Select(x => x.Trim())
                         .ToArray();
            var hardwareName = tokens[0];
            var softwareName = tokens[1];

            if (computer.Any(x => x.Name == hardwareName))
            {
                var hardware = computer.FirstOrDefault(x => x.Name == hardwareName);

                if (hardware.Software().Any(x => x.Name == softwareName))
                {
                    SoftwareComponent software = hardware.Software().FirstOrDefault(x => x.Name == softwareName);
                    hardware.RemoveSoftwareComponent(software);
                    hardware.UsedCapacity -= software.CapacityConsumption;
                    hardware.UsedMemory   -= software.MemoryConsumption;
                }
            }
        }
 public void RemoveSoftwareComponent(SoftwareComponent software)
 {
     this.softwareComponents.Remove(software);
 }
 public void AddSoftwareComponent(SoftwareComponent software)
 {
     this.softwareComponents.Add(software);
 }