protected virtual void AddNewCategory(string _categoryKey) { if (!IsCategoryForThisGame(_categoryKey)) { return; } CategoryData data = new CategoryData(); if (!categoryStorage.HasCategory(gameName, _categoryKey)) { return; } data = categoryStorage.GetData(gameName, _categoryKey); var obj = Instantiate(categoryCardPref, categoryParent.transform); var categoryPanel = Instantiate(categoryPanelPref, panelParent); CategoriesPanels.Add(categoryPanel); categoryPanel.SetActive(false); var categoryInit = obj.GetComponent <CategoryInitializer>(); categoryInit.Initialize(gameName, _categoryKey, data); CategoryCards.Add(categoryInit); InitializeCategoryPanel(categoryPanel); InitializeEditableElement(obj, data.visible); BindCategoryBtn(CategoryCards.Count - 1); CalculateCategoryPanelRect(); InitializePanel(categoryPanel); ConfigurateCards(data, categoryPanel, _categoryKey); }
private void GetData() { string connectionString = ConfigurationManager.ConnectionStrings["Shop"].ConnectionString; CategoryStorage cs = new CategoryStorage(); cs.Connection = new System.Data.SqlClient.SqlConnection(connectionString); var table = cs.GetData(); //Form.bsForm.DataSource = collection; Form.bsDGW.DataSource = table; }
public void SetCurrentCategory(string _categoryKey, GameObject cardsPanel) { lastCardsPanel = cardsPanel; currentCategory = categoryStorage.GetData(GameName.WordBook, _categoryKey); }