public HouseholdTraitPresenter([NotNull] ApplicationPresenter applicationPresenter, [NotNull] HouseholdTraitView view,
                                       [NotNull] HouseholdTrait householdTrait)
            : base(view, "ThisHouseholdTrait.HeaderString", householdTrait, applicationPresenter)
        {
            _hht = householdTrait;
            _selectedAddCategory     = CategoryOrDevice[0];
            _autoSelectedAddCategory = CategoryOrDevice[0];
            if (_hht.Locations.Count > 0)
            {
                SelectedAffLocation = _hht.Locations[0];
            }

            RefreshRelevantAffordancesForAdding();

            if (_relevantAffordances.Count > 0)
            {
                SelectedAffordance = _relevantAffordances[0];
            }

            SelectedHouseholdTrait = Sim.HouseholdTraits[0];
            RefreshUses();
            RefreshClassifications();
            foreach (TimeType type in Enum.GetValues(typeof(TimeType)))
            {
                TimeTypes.Add(type);
            }
        }
Beispiel #2
0
        public usrSupplementsCycleDosageEditor()
        {
            InitializeComponent();

            foreach (DosageType dosageType in Enum.GetValues(typeof(DosageType)))
            {
                DosageTypes.Add(new ListItem <DosageType>(EnumLocalizer.Default.Translate(dosageType), dosageType));
            }
            foreach (DosageUnit dosageUnit in Enum.GetValues(typeof(DosageUnit)))
            {
                DosageUnits.Add(new ListItem <DosageUnit>(EnumLocalizer.Default.Translate(dosageUnit), dosageUnit));
            }
            foreach (SupplementCycleDayRepetitions repetition in Enum.GetValues(typeof(SupplementCycleDayRepetitions)))
            {
                Repetitions.Add(new ListItem <SupplementCycleDayRepetitions>(EnumLocalizer.Default.Translate(repetition), repetition));
            }
            foreach (TimeType timeType in Enum.GetValues(typeof(TimeType)))
            {
                TimeTypes.Add(new ListItem <TimeType>(EnumLocalizer.Default.Translate(timeType), timeType));
            }
        }