Esempio n. 1
0
        public override void AddNewSubcat(BudgetSubcatEdit subcat)
        {
            var newSubcat = PlannedSubcat.Create(subcat.Name, subcat.Id);

            newSubcat.PropertyChanged += OnSubcatChanged;
            subcats.Add(newSubcat);
        }
Esempio n. 2
0
        public static PlannedSubcat Create(string subcatName, int id)
        {
            var subcat = new PlannedSubcat
            {
                Name = subcatName,
                Id   = id
            };

            return(subcat);
        }
Esempio n. 3
0
        public static BudgetPlannedCategory Create(BudgetCategoryTemplate categoryDesc)
        {
            var category = new BudgetPlannedCategory()
            {
                Name     = categoryDesc.Name,
                Id       = categoryDesc.Id,
                IsIncome = categoryDesc.IsIncome,
                IconName = categoryDesc.IconFileName
            };

            int index = 0;

            foreach (string subcatName in categoryDesc.subcategories)
            {
                var subcat = PlannedSubcat.Create(subcatName, index++);
                subcat.PropertyChanged += category.OnSubcatChanged;
                category.subcats.Add(subcat);
            }

            return(category);
        }