Ejemplo n.º 1
0
        public void MaximumValueChanged(FixedLimitGroupingDTO fixedLimitGroupingDTO, double?newMaximum)
        {
            fixedLimitGroupingDTO.Maximum = newMaximum;
            var nextItem = _fixedLimitDTOs[_fixedLimitDTOs.IndexOf(fixedLimitGroupingDTO) + 1];

            nextItem.Minimum = newMaximum;
        }
 protected override void Context()
 {
     base.Context();
     sut.InitializeWith(_field, _populationDataCollector);
     sut.StartCreate();
     _firstItem         = _allDTOs.First();
     _lastItem          = _allDTOs.Last();
     _firstItem.Maximum = 15;
 }
Ejemplo n.º 3
0
        public void AddFixedLimitAfter(FixedLimitGroupingDTO fixedLimitGroupingDTO)
        {
            if (fixedLimitGroupingDTO == null)
            {
                return;
            }

            //Insert a new item right after the given dto using the maximum of the previous one as minimum (already in display unit)
            var newLimit = newDTO(minimumInDisplayUnit: fixedLimitGroupingDTO.Maximum);

            _fixedLimitDTOs.Insert(_fixedLimitDTOs.IndexOf(fixedLimitGroupingDTO) + 1, newLimit);
            MaximumValueChanged(newLimit, newLimit.Maximum);
        }
Ejemplo n.º 4
0
        private RepositoryItem getButtonRepository(FixedLimitGroupingDTO groupingDTO)
        {
            if (groupingDTO.CanDelete)
            {
                return(_addAndRemoveButtonRepository);
            }

            if (groupingDTO.CanAdd)
            {
                return(_addButtonRepository);
            }

            return(_disableRemoveButtonRepository);
        }
Ejemplo n.º 5
0
        public void RemoveFixedLimit(FixedLimitGroupingDTO fixedLimitGroupingDTO)
        {
            if (fixedLimitGroupingDTO == null)
            {
                return;
            }

            var index = _fixedLimitDTOs.IndexOf(fixedLimitGroupingDTO);

            _fixedLimitDTOs.Remove(fixedLimitGroupingDTO);

            //We have to update the maximum of the entry  after the one deleted with the maximum of the entry before the one deleted
            //hence -1
            var dto = _fixedLimitDTOs[index - 1];

            MaximumValueChanged(dto, dto.Maximum);
        }
        protected override void Context()
        {
            base.Context();
            sut.InitializeWith(_field, _populationDataCollector);
            sut.StartCreate();

            _firstItem = _allDTOs.First();
            _lastItem  = _allDTOs.Last();
            //add items
            sut.AddFixedLimitAfter(_firstItem);
            _secondItem = _allDTOs.ElementAt(1);

            _firstItem.Maximum  = 15;
            _secondItem.Minimum = 15;
            _secondItem.Maximum = 20;
            _lastItem.Minimum   = 20;
            _lastItem.Maximum   = 30;
        }
        protected override void Context()
        {
            base.Context();
            sut.InitializeWith(_field, _populationDataCollector);
            sut.StartCreate();
            _firstItem = _allDTOs.First();
            _lastItem  = _allDTOs.Last();
            //add items
            sut.AddFixedLimitAfter(_firstItem);
            _secondItem = _allDTOs.ElementAt(1);

            _firstItem.Maximum  = 15;
            _firstItem.Label    = "Label1";
            _secondItem.Maximum = 20;
            _secondItem.Label   = "Label2";
            _lastItem.Maximum   = 30;
            _lastItem.Label     = "Label3";

            _maximum1 = 1;
            _maximum2 = 2;

            A.CallTo(() => _dimension.UnitValueToBaseUnitValue(_unit, _firstItem.Maximum.Value)).Returns(_maximum1);
            A.CallTo(() => _dimension.UnitValueToBaseUnitValue(_unit, _secondItem.Maximum.Value)).Returns(_maximum2);
        }
Ejemplo n.º 8
0
 private void maximumValueChanged(FixedLimitGroupingDTO dto, double?newValue)
 {
     _presenter.MaximumValueChanged(dto, newValue);
     //Required so that changed are being propagated to data source (only works when leaving row otherwise)
     gridControl.RefreshDataSource();
 }