public static Category RegisterCategory(string name) { Category category; if (m_mapCategories.TryGetValue(name, out category)) return category; category = new Category(name); m_hshCategories.Add(category); m_mapCategories.Add(name, category); if (CategoryAdded != null) { var args = new CategoryManagerEventArgs(category); CategoryAdded(null, args); } return category; }
public Asset(dynamic json) { m_strName = json.name; m_strType = json.type; m_Category = CategoryManager.RegisterCategory(json.category); }
public static IList<Asset> GetAssetsForCategory(Category category) { return m_mapAssets.Select(x => x.Value).Where(x => x.Category == category).ToList(); }
public CategoryManagerEventArgs(Category category) { Category = category; }