Exemplo n.º 1
0
 public BudgetPlanned(BudgetPlanned budgetPlanned)
 {
     foreach (BudgetPlannedCategory category in budgetPlanned.Categories)
     {
         var newCategory = new BudgetPlannedCategory(category);
         newCategory.PropertyChanged += OnCategoryModified;
         Categories.Add(newCategory);
     }
 }
Exemplo n.º 2
0
 public void Setup(List <BudgetCategoryTemplate> categoriesDesc)
 {
     Categories.Clear();
     foreach (BudgetCategoryTemplate categoryDesc in categoriesDesc)
     {
         var plannedCategory = BudgetPlannedCategory.Create(categoryDesc);
         plannedCategory.PropertyChanged += OnCategoryModified;
         Categories.Add(plannedCategory);
     }
 }
Exemplo n.º 3
0
 public BudgetPlannedCategory(BudgetPlannedCategory category) : base(category)
 {
     foreach (var subcat in category.subcats)
     {
         //??
         //var plannedSubcat = new PlannedSubcat(subcat);
         //plannedSubcat.PropertyChanged += OnSubcatChanged;
         subcats.Add(new PlannedSubcat(subcat));
     }
 }
Exemplo n.º 4
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);
        }