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); }
private void editUnitForCurrentMap(BaseEdit baseEdit, DefaultUnitMapDTO unitMap) { baseEdit.FillComboBoxEditorWith(_presenter.AllUnitsFor(unitMap.Dimension)); }
private void editDimensionForCurrentMap(BaseEdit baseEdit, DefaultUnitMapDTO unitMap) { baseEdit.FillComboBoxEditorWith(_presenter.AllPossibleDimensionsFor(unitMap)); }
public void RemoveDefaultUnit(DefaultUnitMapDTO defaultUnitMapDTO) { _unitsManager.RemoveDefaultUnit(defaultUnitMapDTO.Subject); bindToView(); }