public Task Stocks() { GroupStock stocks = _crawling.Stocks(); aTimer.Start(); return(Clients.All.SendAsync("ReceiveStocks", stocks)); }
void SetFactories(Game game) { game.CameraManager = _cameraManager; game.BackgroundFactory = _backgroundFactory; IBlockFactory blockFactory = new BlockFactory(_blockViewSpawner); IGroupFactory groupFactory = new GroupFactory(blockFactory, _groupPatterns); IGroupStock groupStock = new GroupStock(groupFactory); groupStock.StockDisplayConfig = _setting.StockPositions; groupStock.Prepare(_setting); game.GroupFactory = groupStock; var gridFactory = new GridFactory(_setting, groupStock); game.GridFactory = gridFactory; }
/// <summary> /// Shows the stock panel. /// </summary> /// <param name="stockStatusType">Type of the stock status.</param> private void ShowStockPanel(StockStatusType stockStatusType) { this.selectedGroup = null; this.selectedCard = null; this.selectedRecord = null; this.selectedCustomer = null; this.ActivateMenuButtons(); this.recordsStackPanel.Visibility = System.Windows.Visibility.Collapsed; this.cardStackPanel.Visibility = System.Windows.Visibility.Collapsed; this.customerStackPanel.Visibility = System.Windows.Visibility.Collapsed; this.stockStackPanel.Visibility = System.Windows.Visibility.Visible; int year = stockStatusType == StockStatusType.Current ? -1 : this.selectedStockYear; List <GroupStock> stock = DataManager.Instance.GetGroupStock(stockStatusType, year); switch (stockStatusType) { case StockStatusType.Current: this.stockPanelTitle.Text = "Aktuální stav zásob"; break; case StockStatusType.AfterYear: this.stockPanelTitle.Text = String.Format("Stav zásob po roce {0}", this.selectedStockYear); break; case StockStatusType.ForYear: this.stockPanelTitle.Text = String.Format("Stav zásob pro rok {0}", this.selectedStockYear); break; } this.stockPriceListBox.ItemsSource = stock; this.stockCountAndPriceListBox.ItemsSource = stock; GroupStock summaryStock = DataManager.Instance.GetSummaryStock(stockStatusType, year); this.stockSummaryStackPanel.DataContext = new { SummaryName = summaryStock.Name, SummaryCount = String.Format("{0} ks", summaryStock.Count), SummaryPrice = String.Format("{0} Kč", summaryStock.Price) }; }