internal void StopPriceService() { if (_priceService.IsStarted) { _priceService.Stop(); } }
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(); }
private void StopPriceService(object parameter) { _token.Cancel(); priceService.Stop(); toggleButton = true; }