示例#1
0
        static void Main(string[] args)
        {
            EnterUsername  enterUsername = new EnterUsername();
            SaveToDatabase save          = new SaveToDatabase(new Database(), "this_computer");

            User user = new User();

            user.SetCommand(enterUsername);
            user.ExecuteCommand();
            user.SetCommand(save);
            user.ExecuteCommand();

            Console.ReadLine();
        }
示例#2
0
文件: Class.cs 项目: zateus/OSBB
        void Main()
        {
            User         invoker  = new User(1, "F*g", 3, "User");
            Admin        receiver = new Admin(2, "Alex", 12);
            UsingCommand command  = new UsingCommand(receiver);

            invoker.SetCommand(command);
            invoker.Run();
        }