コード例 #1
0
ファイル: PoliceCarFactory.cs プロジェクト: klahox/Tests
        public PoliceCar Create(int milage, bool serviceRequired)
        {
            PoliceCar polCar = new PoliceCar();

            polCar._mileAge       = milage;
            polCar.ReadForService = serviceRequired;

            return(polCar);
        }
コード例 #2
0
        public static void ISNotMain(string[] args)
        {
            PoliceCarFactory factory = new PoliceCarFactory();

            PoliceCarController controller = new PoliceCarController(factory);

            PoliceCar pc = controller.New(233, true);

            Console.WriteLine(pc.ReadForService + " - " + pc._mileAge);


            Console.Read();
        }