Esempio n. 1
0
        static void Main(string[] args)
        {
            Stock stock = new Stock();

            Broker brokerIvan = new Broker("Иван", stock);
            Bank   bankSber   = new Bank("Сбербанк", stock);

            stock.Market();
            Console.WriteLine(new string('-', 55));

            stock.Market();
            Console.WriteLine(new string('-', 55));

            stock.Market();
            Console.WriteLine(new string('-', 55));

            brokerIvan.StopTrade();

            Console.WriteLine(new string('=', 55));

            stock.Market();
            stock.Market();

            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Stock  stock  = new Stock();
            Banck  banck  = new Banck("Bank 1 ", stock);
            Banck  banck2 = new Banck("Bank 2 ", stock);
            Broker broker = new Broker("Broker 1", stock);

            stock.Market();
            stock.Market();
            broker.StopTrade();
            banck.StopTrade();
            banck2.StopTrade();
            Console.Read();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Stock  stock  = new Stock();
            Bank   bank   = new Bank("ЮнитБанк", stock);
            Broker broker = new Broker("Иван Иваныч", stock);

            // имитация торгов
            stock.Market();
            // брокер прекращает наблюдать за торгами
            broker.StopTrade();
            // имитация торгов
            stock.Market();

            Console.Read();
        }
Esempio n. 4
0
        static void Main()
        {
            Stock  stock  = new Stock();
            Bank   bank   = new Bank("American Express", stock);
            Broker broker = new Broker("John Smith", stock);

            // Imitation trading
            stock.Market();
            //Stop trading
            broker.StopTrade();
            // Imitation trading
            stock.Market();

            Console.Read();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Stock  stock  = new Stock();
            Bank   bank   = new Bank("UnitBank", stock);
            Broker broker = new Broker("Ivan Inavovich", stock);

            // imitation of trades
            stock.Market();
            // the broker stops watching trades
            broker.StopTrade();
            // imitation of trades
            stock.Market();

            Console.Read();
        }
Esempio n. 6
0
        private static void Main()
        {
            var stock  = new Stock();
            var bank   = new Bank("TestBank", stock);
            var broker = new Broker("TestBroker", stock);

            stock.Market();

            broker.StopTrade();

            stock.Market();

            bank.StopTrade();

            stock.Market();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            Stock  stock  = new Stock();
            Bank   bank   = new Bank("Steel", stock);
            Broker broker = new Broker("Alex", stock);

            stock.Market();
            stock.Market();
            stock.Market();

            broker.StopTrade();

            stock.Market();
            stock.Market();

            Console.ReadLine();
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            Stock  stock  = new Stock();
            Bank   bank   = new Bank("ЮнитБанк", stock);
            Broker broker = new Broker("Иван Иваныч", stock);

            stock.Market();

            broker.StopTrade();

            stock.Market();

            string mess = "Hello me";

            mess += " art";
            mess.Replace("me", "eleks");
            Console.WriteLine(mess);
            Console.Read();
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Title           = "Observer";

            Stock stock = new Stock();

            Bank   bank   = new Bank("ЮнитБанк", stock);
            Broker broker = new Broker("Василий Иванович", stock);

            // Имитация торгов
            stock.Market();

            broker.StopTrade();

            // имитация торгов
            stock.Market();

            Console.ReadKey();
        }
Esempio n. 10
0
        /// <summary>
        /// The main.
        /// </summary>
        private static void Main()
        {
            var stock  = new Stock();
            var broker = new Broker(stock);

            broker.AddSubscribe();
            stock.Market();
            stock.Market();
            stock.Market();
            stock.Market();

            broker.RemoveSubscribe();
            stock.Market();
            stock.Market();
            stock.Market();
            stock.Market();

            Console.ReadLine();
        }