Exemplo n.º 1
0
        static void Main(string[] args)
        {
            List<decimal> decs = new List<decimal> { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            BankAccounts first = new BankAccounts();

            first.on_add += n => Console.WriteLine("First add {0}",n);

            first +=20;

            BankAccounts second = new BankAccounts();
            second.on_add += n => Console.WriteLine("Second add {0}", n);
            second += decs;
            first += second;

            Console.WriteLine("Sum of first = {0}", first.Sum());
            Console.WriteLine("Sum of both = {0}", new BankAccounts().Add(first).Add(second).Sum());
            Console.WriteLine("first: {0}", first.ToString());

            Console.ReadKey();
        }