コード例 #1
0
        protected override void Context()
        {
            _view                        = A.Fake <IFavoriteParametersView>();
            _parameterTask               = A.Fake <IParameterTask>();
            _favoriteRepository          = A.Fake <IFavoriteRepository>();
            _multiParameterEditPresenter = A.Fake <IMultiParameterEditPresenter>();
            _favoriteTask                = A.Fake <IFavoriteTask>();

            sut = new FavoriteParametersPresenter(_view, _multiParameterEditPresenter, _parameterTask, _favoriteRepository, _favoriteTask);

            _par1       = new PKSimParameter().WithName("par1");
            _par2       = new PKSimParameter().WithName("par2");
            _par3       = new PKSimParameter().WithName("par3");
            _parameters = new List <IParameter> {
                _par1, _par2, _par3
            };
            var pathCache = new PathCache <IParameter>(A.Fake <IEntityPathResolver>())
            {
                { "par1", _par1 }, { "par2", _par2 }, { "par3", _par3 }
            };

            A.CallTo(() => _parameterTask.PathCacheFor(_parameters)).Returns(pathCache);
            _favorites = new List <string>();
            A.CallTo(() => _favoriteRepository.All()).Returns(_favorites);

            A.CallTo(() => _multiParameterEditPresenter.Edit(A <IEnumerable <IParameter> > ._))
            .Invokes(x => _allEditedParameters = x.GetArgument <IEnumerable <IParameter> >(0));
        }
コード例 #2
0
 public void Edit(IAdvancedParameter advancedParameter)
 {
     _advancedParameter    = advancedParameter;
     _advancedParameterDTO = _advancedParameterDTOMapper.MapFrom(_advancedParameter);
     _distributionParameterPresenter.Edit(_advancedParameterDTO.Parameters);
     _view.BindTo(_advancedParameterDTO);
 }
コード例 #3
0
        private void bindToDynamicParameters()
        {
            var allDynamicParameters = _protocolTask.AllDynamicParametersFor(_protocol);

            _dynamicParameterPresenter.Edit(allDynamicParameters);
            updateViewLayout();
        }
コード例 #4
0
 public void Edit(IEnumerable <IParameter> parameters)
 {
     _allParameters            = parameters.ToList();
     _simulationExpressionsDTO = _simulationExpressionsDTOMapper.MapFrom(_allParameters);
     _moleculeParametersPresenter.Edit(_simulationExpressionsDTO.MoleculeParameters);
     _expressionParametersPresenter.Edit(_simulationExpressionsDTO.ExpressionParameters);
 }
コード例 #5
0
        public void Edit(IEnumerable <IParameter> parameters)
        {
            var allParameters = parameters.ToList();

            _pathCache = _parameterTask.PathCacheFor(allParameters);
            _simulationExpressionsDTO = _simulationExpressionsDTOMapper.MapFrom(allParameters);
            _moleculeParametersPresenter.Edit(_simulationExpressionsDTO.MoleculeParameters);
            _view.BindTo(_simulationExpressionsDTO);
        }
コード例 #6
0
 public void EditFormulation(Formulation formulation)
 {
     Formulation     = formulation;
     _formulationDTO = _formulationDTOMapper.MapFrom(formulation);
     adjustParameterVisibility();
     if (Formulation.IsTable)
     {
         _view.AddParameterView(_tableFormulationPresenter.BaseView);
         _tableFormulationPresenter.Edit(formulation);
     }
     else
     {
         _formulationParametersPresenter.Edit(_formulationDTO.Parameters);
         _view.AddParameterView(_formulationParametersPresenter.View);
     }
     updatePlot();
     _view.BindTo(_formulationDTO);
 }
コード例 #7
0
        public void Edit(Formulation formulation)
        {
            var allParameters  = formulation.AllParameters().ToList();
            var fractionOfDose = allParameters.FindByName(CoreConstants.Parameter.FRACTION_DOSE);

            allParameters.Remove(fractionOfDose);

            _formulationParametersPresenter.Edit(allParameters);
            _tableParameterPresenter.Edit(fractionOfDose);
        }
コード例 #8
0
        private void updateParameters()
        {
            _allFavorites.Clear();
            _allFavorites.AddRange(allFavoriteParameters());
            _multiParameterEditPresenter.Edit(_allFavorites);

            //this needs to be done after the Edit to override whatever settings was updated in the Edit method
            _multiParameterEditPresenter.DistributionVisible  = false;
            _multiParameterEditPresenter.ParameterNameVisible = true;

            updateMoveButtonsEnableState(_allFavorites.Any());
        }
コード例 #9
0
        public void Edit(IEnumerable <IParameter> parameters)
        {
            _allParameters = parameters.ToList();
            _molWeightGroupPresenter.EditCompoundParameters(_allParameters);
            _compoundTypeGroupPresenter.EditCompoundParameters(_allParameters);
            _advancedParameterPresenter.Edit(_allParameters.Where(parameterIsAdvancedParameter));
            _simpleParameterPresenter.Edit(_allParameters.Where(parameterIsSimpleParameter));

            var compoundProperties = compoundPropertiesFor(_allParameters);

            if (compoundProperties != null)
            {
                _calculationMethodsPresenter.Edit(compoundProperties);
            }
            else
            {
                hideCalculationMethodView();
            }
        }
コード例 #10
0
 public void EditHalogens(IEnumerable <IParameter> halogenParameters)
 {
     _parameterEditPresenter.Edit(halogenParameters);
 }
コード例 #11
0
 public void Edit(IEnumerable <IParameter> calculatedParameters)
 {
     _multiParameterEditPresenter.Edit(calculatedParameters);
 }
コード例 #12
0
 public void EditHalogens(IEnumerable <IParameter> compoundParameters)
 {
     _paramEditPresenter.Edit(compoundParameters.Where(isHalogens));
 }
コード例 #13
0
 public virtual void EditCompound(Compound compound)
 {
     _parameterEditPresenter.Edit(_parameterGroupTask.ParametersIn(_groupName, compound.AllParameters()));
     _view.AdjustHeight();
 }