Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            string name = Console.ReadLine();

            var ph = new PowerHardware(name);

            ph.PrintName();

            //ph.Name = "Daniel";
            //ph.PrintName();
        }