Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var priceService = new RandomWalkPriceService();
            priceService.NewPricesArrived += PriceUpdateHandler;
            priceService.Start();

            while (true)
            {
                ConsoleKeyInfo key = Console.ReadKey();
                if (key.Key == ConsoleKey.D)
                {
                    Console.WriteLine("Done");
                    break;
                }
            }

            priceService.Stop();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method will subsccribe to NewPriceArrived event, this even will be raised 20 times in a second
 /// and hence the handler will also be invoked that many times
 /// </summary>
 void InitializeTradeService()
 {
     InitializeDummyInstruments();
     priceService = new RandomWalkPriceService();
     priceService.NewPricesArrived += PriceUpdateHandler;
 }