Esempio n. 1
0
        static void Main()
        {
            var door = new SecuredDoor(new LabDoor());

            door.Open("hunter2");
            door.Close();

            door.Open("$3CRET");
            door.Close();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IDoor       labdoor    = new LabDoor();
            SecuredDoor securedoor = new SecuredDoor(labdoor);

            securedoor.Open("random");
            securedoor.Open("secret");
            securedoor.Close();

            Console.ReadKey();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var door = new SecuredDoor(new WoodDoor());

            Console.WriteLine("Now open the door");
            door.Open("correct_key");

            Console.WriteLine("\n");

            Console.WriteLine("Now close the door");
            door.Close();

            Console.ReadKey();
        }