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(); }
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(); }