示例#1
0
 public DeviceCategoryPresenter(
     [NotNull] ApplicationPresenter applicationPresenter,
     [NotNull] DeviceCategoryView view, [NotNull] DeviceCategory deviceCategory)
     : base(view, "ThisDeviceCategory.Name", deviceCategory, applicationPresenter)
 {
     _deviceCategory = deviceCategory;
     _dcp            = new DeviceCategoryPickerPresenter(Sim, _deviceCategory,
                                                         view.DeviceCategoryPicker1);
     view.DeviceCategoryPicker1.DataContext = _dcp;
     _selectedParentCategory = _deviceCategory.ParentCategory;
     _deviceCategory.RefreshSubDevices();
     _usedIns = new ObservableCollection <UsedIn>();
     RefreshUsedIn();
 }
        public DevicePresenter([NotNull] ApplicationPresenter applicationPresenter, [NotNull] DeviceView view, [NotNull] RealDevice realDevice)
            : base(view, "ThisDevice.HeaderString", realDevice, applicationPresenter)
        {
            _realDevice = realDevice;
            DeviceCategoryPickerPresenter = new DeviceCategoryPickerPresenter(Sim,
                                                                              _realDevice.DeviceCategory, view.DeviceCategoryPicker1);
            view.DeviceCategoryPicker1.DataContext = DeviceCategoryPickerPresenter;
            DeviceCategoryPickerPresenter.Select();
            DeviceCategoryPickerPresenter.PropertyChanged += DcpOnPropertyChanged;
            _timeProfileTypes.Add(TimeProfileType.Relative);
            _timeProfileTypes.Add(TimeProfileType.Absolute);
            var u = ThisDevice.CalculateUsedIns(Sim);

            _usedIns.SynchronizeWithList(u);
        }