/// <summary> /// Get list of data referenced in CurrentCategory. /// </summary> /// <returns></returns> public List <DataModel> GetData(CategoryModel ofCategory) { List <DataModel> dataList = new List <DataModel>(); if (ofCategory.DataIndexes.Count == 0) { return(dataList); } dataList.Capacity = ofCategory.DataIndexes.Count; foreach (var dataIndex in ofCategory.DataIndexes) { dataList.Add(dataController.Get(SecureManager.GetIndexOf(dataIndex))); } return(dataList); }
/// <summary> /// Replace old category by new. /// </summary> public void ReplaceCategory(CategoryModel oldCategory, CategoryModel newCategory) { for (int i = 0; i < categoryController.Count(); i++) { if (categoryController.Get(i).Equals(oldCategory)) { categoryController.PasteAt(i, newCategory); break; } } }