Program.cs 715 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace BuilderPattern
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. Director director = new Director();
  13. HpBulider hpBuilder = new HpBulider();
  14. DellBulider dellBuilder =new DellBulider();
  15. //组装一批惠普电脑
  16. Computer hp =director.Construct(hpBuilder);
  17. hp.ShowSteps();
  18. Console.ReadLine();
  19. //组装一批戴尔电脑
  20. Computer dell = director.Construct(dellBuilder);
  21. dell.ShowSteps();
  22. Console.ReadLine();
  23. }
  24. }
  25. }