Exemplo n.º 1
0
        public Notifier(BuySystem buySystem)
        {
            _buySystem = buySystem;

            // Subscribe to event
            _buySystem.PushNotification += Notification;
        }
 public BuySystemCLI(BuySystem buySystem)
 {
     _buySystem = buySystem;
     _notifier  = new Notifier(_buySystem);
 }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            /*
             * List<User> users = new List<User>()
             * {
             *  new User(){Id = 4, Username = "******"},
             *  new User(){Id = 2, Username = "******"},
             *  new User(){Id = 5, Username = "******"},
             *  new User(){Id = 3, Username = "******"},
             *  new User(){Id = 1, Username = "******"}
             * };
             *
             * //users.Sort(new CompareUserByUsernameReverse());
             *
             * //foreach (var user in users)
             * //{
             * //    Console.WriteLine(user);
             * //}
             *
             * Collection<User> userz = new Collection<User>();
             *
             * // Initializing this collection from other list
             * foreach (var user in users)
             * {
             *  userz.Add(user);
             * }
             *
             * foreach (var user in userz)
             * {
             *  Console.WriteLine(user);
             * }
             *
             *
             * Collection<Transaction> transactions = new Collection<Transaction>();
             *
             * Transaction transaction1 = new Transaction();
             * Transaction transaction2 = new Transaction();
             * Transaction transaction3 = new Transaction();
             *
             * transactions.Add(transaction1);
             * transactions.Add(transaction2);
             * transactions.Add(transaction3);
             *
             * foreach (var transaction in transactions)
             * {
             *  Console.WriteLine(transaction.Id);
             * }
             *
             */

            BuySystem    buySystem    = new BuySystem();
            BuySystemCLI buySystemCli = new BuySystemCLI(buySystem);

            buySystemCli.Start();

            /*
             * var searchedTransactions = buySystem.GetTransactions(users[0], 10);
             *
             * foreach (var searchedTransaction in searchedTransactions)
             * {
             *    Console.WriteLine(searchedTransaction);
             * }
             */
        }