Esempio n. 1
0
 public Desktop(Cooler cooler, DesktopCPU cpu, Disk drive, DesktopGPU gpu, DesktopMotherboard motherboard, PSU psu, RAM ram)
 {
     try
     {
         if (cooler == null)
         {
             throw new ArgumentNullException("cooler");
         }
         if (cpu == null)
         {
             throw new ArgumentNullException("cpu");
         }
         if (drive == null)
         {
             throw new ArgumentNullException("drive");
         }
         if (gpu == null)
         {
             throw new ArgumentNullException("gpu");
         }
         if (motherboard == null)
         {
             throw new ArgumentNullException("motherboard");
         }
         if (psu == null)
         {
             throw new ArgumentNullException("psu");
         }
         if (ram == null)
         {
             throw new ArgumentNullException("ram");
         }
         Cooler       = cooler;
         _cpu         = cpu;
         _disk        = drive;
         _gpu         = gpu;
         _motherboard = motherboard;
         _psu         = psu;
         _ram         = ram;
     }
     catch (ArgumentNullException exception)
     {
         throw exception;
     }
     catch (ArgumentException exception)
     {
         throw exception;
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
Esempio n. 2
0
 public static Desktop CreateDesktop(Cooler cooler, DesktopCPU cpu, Disk disk, DesktopGPU gpu, DesktopMotherboard motherboard, PSU psu, RAM ram)
 {
     return(new Desktop(cooler, cpu, disk, gpu, motherboard, psu, ram));
 }