Exemple #1
0
        /// <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);
        }
Exemple #2
0
 /// <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;
         }
     }
 }