예제 #1
0
        public IEnumerable <IDimension> AllPossibleDimensionsFor(DefaultUnitMapDTO defaultUnitMapDTO)
        {
            var allDimensions    = _dimensionFactory.Dimensions.ToList();
            var currentDimension = defaultUnitMapDTO.Dimension;

            //Removes all dimensions already map but the one being currently edited
            _unitsManager.AllDisplayUnits
            .Where(d => !Equals(d.Dimension, currentDimension))
            .Each(d => allDimensions.Remove(d.Dimension));

            return(allDimensions);
        }
        protected override void Context()
        {
            base.Context();
            _displayUnitManager.AddDisplayUnit(new DisplayUnitMap {
                Dimension = _dimension1, DisplayUnit = _dimension1.DefaultUnit
            });
            var defaultUnitMap = new DisplayUnitMap {
                Dimension = _dimension2, DisplayUnit = _dimension2.DefaultUnit
            };

            _displayUnitManager.AddDisplayUnit(defaultUnitMap);
            _defaultUnitMapDTO = new DefaultUnitMapDTO(defaultUnitMap);
            sut.Edit(_displayUnitManager);
        }
예제 #3
0
 private void editUnitForCurrentMap(BaseEdit baseEdit, DefaultUnitMapDTO unitMap)
 {
     baseEdit.FillComboBoxEditorWith(_presenter.AllUnitsFor(unitMap.Dimension));
 }
예제 #4
0
 private void editDimensionForCurrentMap(BaseEdit baseEdit, DefaultUnitMapDTO unitMap)
 {
     baseEdit.FillComboBoxEditorWith(_presenter.AllPossibleDimensionsFor(unitMap));
 }
예제 #5
0
 public void RemoveDefaultUnit(DefaultUnitMapDTO defaultUnitMapDTO)
 {
     _unitsManager.RemoveDefaultUnit(defaultUnitMapDTO.Subject);
     bindToView();
 }