示例#1
0
 public DeviceOverviewPresenter([NotNull] ApplicationPresenter applicationPresenter, [NotNull] DeviceOverviewView view)
     : base(view, "HeaderString", applicationPresenter)
 {
     SortByOptions.Add("By Name");
     SortByOptions.Add("By Category");
     SortBy = "By Name";
     Resort();
 }
示例#2
0
 private void SetSortByOptions(ICollection <string> items)
 {
     foreach (var item in items)
     {
         SortByOptions.Add(item);
         SortByOptions.Add(item + SortByDescSuffix);
     }
 }
示例#3
0
        private void SetSortByOptions(IEnumerable <string> items)
        {
            SortByOptions.Clear();

            foreach (var item in items)
            {
                SortByOptions.Add(item);
                SortByOptions.Add(item + SortByDescSuffix);
            }
        }
        public HouseholdPlanPresenter([NotNull] ApplicationPresenter applicationPresenter, [NotNull] HouseholdPlanView view,
                                      [NotNull] HouseholdPlan householdPlan)
            : base(view, "ThisHouseholdPlan.HeaderString", householdPlan, applicationPresenter)
        {
            SuspendStatistics = true;
            CalcObjectTypes   = new ObservableCollection <CalcObjectType>
            {
                CalcObjectType.ModularHousehold
            };

            _householdPlan = householdPlan;
            foreach (var entry in _householdPlan.Entries)
            {
                entry.AllDeviceActions = Sim.DeviceActions.It;
            }

            foreach (var dc in Sim.DeviceCategories.MyItems)
            {
                dc.RefreshSubDevices();
            }

            _householdPlan.RefreshTagCategories(Sim.Affordances.It);

            SortByOptions.Add("By Name");
            SortByOptions.Add("By Person");

            SortByOptions.Add("By Activiations");
            SortByOptions.Add("By Desire");
            SortByOptions.Add("By Total Time");
            SortByOptions.Add("By Category");
            SortBy = SortByOptions[1];
            Resort();
            if (householdPlan.CalcObject != null)
            {
                if (householdPlan.CalcObject.GetType() == typeof(ModularHousehold))
                {
                    SelectedCalcObjectType = CalcObjectType.ModularHousehold;
                }
                else
                {
                    throw new LPGException("Unknown ");
                }
            }
            else
            {
                SelectedCalcObjectType = CalcObjectType.ModularHousehold;
            }

            ColorSchemes.Add("By Activations");
            ColorSchemes.Add("By Traits");
            SelectedColorScheme = ColorSchemes[0];
            RefreshPlan();
            RefreshAlTraits();
            RefreshAlAssignments();
        }
示例#5
0
        public AffordanceColorPresenter([NotNull] ApplicationPresenter applicationPresenter,
                                        [NotNull] AffordanceColorView view)
            : base(view, "HeaderString", applicationPresenter)
        {
            SortByOptions.Add("By Name");
            SortByOptions.Add("By Category");
            SortBy = "By Name";
            var myAffordances = new List <Affordance>(Sim.Affordances.MyItems);

            myAffordances.Sort(Comparison);
            _affordances.Clear();
            foreach (var myAffordance in myAffordances)
            {
                _affordances.Add(myAffordance);
            }
        }
        /// <exception cref="Exception">A delegate callback throws an exception.</exception>
        public DeviceTaggingSetPresenter([NotNull] ApplicationPresenter applicationPresenter,
                                         [NotNull] DeviceTaggingSetView view,
                                         [NotNull] DeviceTaggingSet aff) : base(view, "ThisDeviceTaggingSet.HeaderString", aff, applicationPresenter)
        {
            _deviceTaggingSet = aff;
            foreach (var entry in aff.Entries)
            {
                entry.AllTags = aff.Tags;
            }

            RefreshStatistics();
            SortByOptions.Add("By Device");
            SortByOptions.Add("By Device Category");
            SortByOptions.Add("By Tag");
            _sortBy = SortByOptions[0];
            RefreshReferenceStatistic();
        }