Exemplo n.º 1
0
 public PatternViewModel(Pattern pattern, Factories factories,
     IList<InsulinCircumstanceViewModel> allCircumstances, bool hasAlternatives,
     IEnumerable<MealNameViewModel> names, MealNameViewModel defaultName, Navigator navigator, Action save,
     Action showAlternatives)
 {
     Pattern = pattern;
     Match = new MealItemViewModel(pattern.Match, factories);
     From = new MealViewModel(pattern.From, factories);
     From.Names = names;
     From.DefaultName = defaultName;
     Insulin = new InsulinViewModel(pattern.Insulin, factories, allCircumstances: allCircumstances);
     Before = new SugarViewModel(pattern.Before, factories);
     After = pattern.After
         .Select(sugar => new SugarViewModel(sugar, factories))
         .ToList();
     For = new MealItemViewModel(pattern.For, factories);
     HasAlternatives = hasAlternatives;
     this.navigator = navigator;
     this.save = save;
     this.showAlternatives = showAlternatives;
 }
Exemplo n.º 2
0
 private Pattern BuildPattern()
 {
     pattern = new Pattern
     {
         Match = item,
         From = meal,
         Insulin = insulin,
         Before = sugarBefore,
         After = sugarsAfter,
         For = searchedItem
     };
     DoActions();
     return pattern;
 }
Exemplo n.º 3
0
 public ReplacementItem(Pattern pattern)
 {
     Pattern = pattern;
 }