private static void RegisterPowerHardware(string info) { string[] componentInfo = info.Split(new[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries); string name = componentInfo[0]; int capacity = int.Parse(componentInfo[1]); int memory = int.Parse(componentInfo[2]); var powerHardware = new PowerHardware(name, capacity, memory); TheSystem.Components.Add(powerHardware); }
static void Main(string[] args) { string name = Console.ReadLine(); var ph = new PowerHardware(name); ph.PrintName(); //ph.Name = "Daniel"; //ph.PrintName(); }