Example #1
0
        static void Main(string[] args)
        {
            var ibmStock  = new IBM("$", 1000);
            var investor  = new Investor("Pedro Benevides");
            var investor2 = new Investor("Myrelle Coura");

            ibmStock.Attach(investor);
            ibmStock.Attach(investor2);
            ibmStock.Attach(investor2);

            ibmStock.Price = 1500;
        }
Example #2
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main_()
        {
            // Create IBM stock and attach investors
            IBM ibm = new IBM("IBM", 120.00);

            ibm.Attach(new Investor("Sorros"));
            ibm.Attach(new Investor("Berkshire"));

            // Fluctuating prices will notify investors
            ibm.Price = 120.10;
            ibm.Price = 121.00;
            ibm.Price = 120.50;
            ibm.Price = 120.75;

            // Wait for user
            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            // Create IBM stock and attach investors

            IBM ibm = new IBM("IBM", 120.00);

            ibm.Attach(new Investor("Sorros"));
            ibm.Attach(new Investor("Berkshire"));

            // Fluctuating prices will notify investors

            ibm.Price = 120.10;
            ibm.Price = 121.00;
            ibm.Price = 120.50;
            ibm.Price = 120.75;

            Console.WriteLine("Press any key to exit...");
            Console.Read();
        }
        public static void Execute_Example()
        {
            //Create IBM stock and attach investors
            IBM ibm = new IBM("IBM", 120.00);

            ibm.Attach(new Investor("kokan"));
            ibm.Attach(new Investor("maobi"));

            //Fluctuating prices will notify investors
            ibm.Price = 120.10;
            ibm.Price = 121.0;
            ibm.Price = 121.0;
            ibm.Price = 122.75;
            ibm.Price = 120.25;


            // Wait for user
            Console.ReadKey();
        }