Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var commandManagerClient = new CommandManagerClient(new CommandManager());

            commandManagerClient.ExecuteCommands(CommandsToBeExecuted, Product);
            PrintConsole.PrintShoppingCart(ShoppingCartRepository);

            commandManagerClient.UndoLastCommand();

            PrintConsole.PrintShoppingCart(ShoppingCartRepository);
            Console.ReadLine();
        }
Exemplo n.º 2
0
 private static void SetClient(DependencyObject obj, CommandManagerClient value)
 {
     obj.SetValue(ClientProperty, value);
 }
Exemplo n.º 3
0
 private static CommandManagerClient GetClient(DependencyObject obj)
 {
     var client = (CommandManagerClient)obj.GetValue(ClientProperty);
     if (client == null)
     {
         client = new CommandManagerClient();
         SetClient(obj, client);
     }
     return client;
 }