private void ButtonReacativeOnClick(object sender, System.Windows.RoutedEventArgs e) { var cityWeatherRxService = new CityWeatherRxService(); CitiesWithWeather.Clear(); DisplayCount(); var stoper = new Stoper(Time); cityWeatherRxService .SearchCityAndLoadWeatherInfo(TextBox.Text) .Buffer(TimeSpan.FromSeconds(2)) .ObserveOnDispatcher() .Subscribe( x => { foreach (var item in x) { CitiesWithWeather.Add(item); } DisplayCount(); }, () => { stoper.Dispose(); DisplayCount(); }); }
private static async Task GetCustomerPrices() { using (var stoper = new Stoper()) { var customerPrices = await _customerPriceService.GetCustomersPrices(); DisplayCustomerPrices(customerPrices); } Console.WriteLine(); }
private static async Task GetCustomerPrices() { using (var stope = new Stoper()) { var result = await _priceGrpc.GetProductBasePricesAsync(new Google.Protobuf.WellKnownTypes.Empty()); foreach (var item in result.ProductPrices) { DisplayProduct(item); } } }
private static async Task GetCustomerPricesRx() { using (var stope = new Stoper()) { using (var productCall = _priceGrpc.GetProductBasePricesRx(new Google.Protobuf.WellKnownTypes.Empty())) { while (await productCall.ResponseStream.MoveNext(CancellationToken.None)) { DisplayProduct(productCall.ResponseStream.Current); } } } }
private static Task GetProductBasePricesRx() { var productService = new ProductPriceService(); var stoperRx = new Stoper(); productService .GetProductBasePricesRx() .Subscribe( x => HappyConsole.WriteCyanLine($"{x.ProductId,2} - {x.Price,5} - {x.IsActive}"), () => stoperRx.Dispose()); return(Task.CompletedTask); }
private static async Task GetProductBasePrice() { var productService = new ProductPriceService(); using (var stoper = new Stoper()) { var productPrices = await productService.GetProductBasePrices(); foreach (var item in productPrices) { HappyConsole.WriteBlueLine($"{item.ProductId,2} - {item.Price,5} - {item.IsActive}"); } } }
private static Task GetCustomerPricesRx() { var stoper = new Stoper(); DisplayCustomerPricesHeader(); _customerPriceService .GetCustomersPricesRx() .Subscribe( x => DisplaySingleCustomerPrice(x), () => { DisplayCustomerPricesFooter(); stoper.Dispose(); }); return(Task.CompletedTask); }
public void SubscribeStoper(Stoper stoprer) { start = stoprer.Start; stop = stoprer.Stop; }
public CoreWorker() { stoper = new Stoper(); }