Exemplo n.º 1
0
 public EditParametersInContainerPresenter(IEditParametersInContainerView view,
                                           IFormulaToFormulaBuilderDTOMapper formulaMapper,
                                           IParameterToParameterDTOMapper parameterToDTOParameterMapper,
                                           IInteractionTasksForParameter parameterTask,
                                           IEditDistributedParameterPresenter editDistributedParameterPresenter,
                                           IEditParameterPresenter editParameterPresenter,
                                           IQuantityTask quantityTask,
                                           IInteractionTaskContext interactionTaskContext,
                                           IClipboardManager clipboardManager,
                                           IEditTaskFor <IParameter> editTask,
                                           ISelectReferencePresenterFactory selectReferencePresenterFactory,
                                           IFavoriteTask favoriteTask)
     : base(view, quantityTask, interactionTaskContext, formulaMapper, parameterTask, favoriteTask)
 {
     _clipboardManager = clipboardManager;
     _editTask         = editTask;
     _selectReferencePresenterFactory   = selectReferencePresenterFactory;
     _editDistributedParameterPresenter = editDistributedParameterPresenter;
     _editParameterPresenter            = editParameterPresenter;
     EditMode = EditParameterMode.All;
     _parameterToDTOParameterMapper     = parameterToDTOParameterMapper;
     _editParameterPresenter            = editParameterPresenter;
     _editDistributedParameterPresenter = editDistributedParameterPresenter;
     AddSubPresenters(_editDistributedParameterPresenter, _editParameterPresenter);
     _getParametersFunc        = x => x.GetChildrenSortedByName <IParameter>();
     ChangeLocalisationAllowed = true;
 }
Exemplo n.º 2
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));
        }
 protected override void Context()
 {
     _entityPathResolver = A.Fake <IEntityPathResolver>();
     _favoriteRepository = A.Fake <IFavoriteRepository>();
     _view = A.Fake <IEditFavoritesView>();
     _editParameterListPresenter = A.Fake <IEditParameterListPresenter>();
     _favoriteTask = A.Fake <IFavoriteTask>();
     sut           = new EditFavoritesInSimulationPresenter(_view, _favoriteRepository, _entityPathResolver, _editParameterListPresenter, _favoriteTask);
 }
Exemplo n.º 4
0
 protected AbstractParameterBasePresenter(TView view, IQuantityTask quantityTask,
                                          IInteractionTaskContext interactionTaskContext, IFormulaToFormulaBuilderDTOMapper formulaMapper,
                                          IInteractionTasksForParameter parameterTask, IFavoriteTask favoriteTask) : base(view)
 {
     _quantityTask           = quantityTask;
     _interactionTaskContext = interactionTaskContext;
     _formulaMapper          = formulaMapper;
     _parameterTask          = parameterTask;
     _favoriteTask           = favoriteTask;
 }
 public EditFavoritesInSimulationPresenter(
     IEditFavoritesView view,
     IFavoriteRepository favoriteRepository,
     IEntityPathResolver entityPathResolver,
     IEditParameterListPresenter editParameterListPresenter,
     IFavoriteTask favoriteTask)
     : base(view, favoriteRepository, entityPathResolver, editParameterListPresenter, favoriteTask)
 {
     ShouldHandleRemovedEvent = x => false; //Can not remove in Simulation
 }
Exemplo n.º 6
0
 protected override void Context()
 {
     _formulaTypeMapper  = A.Fake <IParameterToFomulaTypeMapper>();
     _executionContext   = A.Fake <IExecutionContext>();
     _entityPathResolver = A.Fake <IEntityPathResolver>();
     _favoriteTask       = A.Fake <IFavoriteTask>();
     _parameterTask      = new ParameterTask(_entityPathResolver, _executionContext, _favoriteTask);
     sut = new ParameterUpdater(_formulaTypeMapper, _parameterTask);
     _sourceParameter = DomainHelperForSpecs.ConstantParameterWithValue(0);
     _sourceParameter.BuildingBlockType = PKSimBuildingBlockType.Individual;
     _targetParameter = DomainHelperForSpecs.ConstantParameterWithValue(1);
     _targetParameter.BuildingBlockType = PKSimBuildingBlockType.Individual;
     A.CallTo(() => _executionContext.BuildingBlockContaining(_targetParameter)).Returns(A.Fake <IPKSimBuildingBlock>());
 }
 public EditParameterListPresenter(
     IEditParameterListView view,
     IQuantityTask quantityTask,
     IInteractionTaskContext interactionTaskContext,
     IFormulaToFormulaBuilderDTOMapper formulaMapper,
     IInteractionTasksForParameter parameterTask,
     IFavoriteTask favoriteTask,
     IViewItemContextMenuFactory viewItemContextMenuFactory,
     IParameterToParameterDTOMapper parameterDTOMapper) :
     base(view, quantityTask, interactionTaskContext, formulaMapper, parameterTask, favoriteTask)
 {
     _viewItemContextMenuFactory = viewItemContextMenuFactory;
     _parameterDTOMapper         = parameterDTOMapper;
 }
Exemplo n.º 8
0
        protected override void Context()
        {
            _executionContext = A.Fake <IExecutionContext>();
            _favoriteTask     = A.Fake <IFavoriteTask>();
            _project          = A.Fake <IProject>();
            sut = new ParameterTask(new EntityPathResolver(new ObjectPathFactoryForSpecs()), _executionContext, _favoriteTask);
            var dimensionFactory = new DimensionFactory();

            _volumeDimension = dimensionFactory.AddDimension(new BaseDimensionRepresentation {
                LengthExponent = 3
            }, "Volume", "L");
            _volumeDimension.AddUnit("mL", 1e-3, 0);
            _parameter           = DomainHelperForSpecs.ConstantParameterWithValue(10);
            _parameter.Dimension = _volumeDimension;
            A.CallTo(() => _executionContext.BuildingBlockContaining(_parameter)).Returns(A.Fake <IPKSimBuildingBlock>());
        }
Exemplo n.º 9
0
 protected EditFavoritesPresenter(
     IEditFavoritesView view,
     IFavoriteRepository favoriteRepository,
     IEntityPathResolver entityPathResolver,
     IEditParameterListPresenter editParameterListPresenter,
     IFavoriteTask favoriteTask)
     : base(view)
 {
     _favoriteRepository         = favoriteRepository;
     _entityPathResolver         = entityPathResolver;
     _editParameterListPresenter = editParameterListPresenter;
     _favoriteTask   = favoriteTask;
     _parameterCache = new Cache <string, IParameter>(pathFor, s => null);
     AddSubPresenters(_editParameterListPresenter);
     _view.AddParametersView(_editParameterListPresenter.BaseView);
 }
Exemplo n.º 10
0
 public FavoriteParametersPresenter(
     IFavoriteParametersView view,
     IMultiParameterEditPresenter multiParameterEditPresenter,
     IParameterTask parameterTask,
     IFavoriteRepository favoriteRepository,
     IFavoriteTask favoriteTask) : base(view)
 {
     _multiParameterEditPresenter = multiParameterEditPresenter;
     _parameterTask      = parameterTask;
     _favoriteRepository = favoriteRepository;
     _favoriteTask       = favoriteTask;
     _allParameterCache  = _parameterTask.PathCacheFor(Enumerable.Empty <IParameter>());
     _view.AddParametersView(_multiParameterEditPresenter.BaseView);
     AddSubPresenters(_multiParameterEditPresenter);
     _multiParameterEditPresenter.ScalingVisible = false;
     _multiParameterEditPresenter.OnSelectedParametersChanged += onSelectedParametersChanged;
 }
Exemplo n.º 11
0
        protected override void Context()
        {
            _view = A.Fake <IEditFavoritesView>();
            _editParameterListPresenter = A.Fake <IEditParameterListPresenter>();
            _favoriteRepository         = A.Fake <IFavoriteRepository>();
            _entityPathResolver         = new EntityPathResolver(new ObjectPathFactory(A.Fake <IAliasCreator>()));
            _favoriteTask = A.Fake <IFavoriteTask>();

            sut = new EditFavoritesInSpatialStructurePresenter(_view, _favoriteRepository, _entityPathResolver, _editParameterListPresenter, _favoriteTask);
            _spatialStructure = new MoBiSpatialStructure();
            var cont = new Container().WithName("root");

            _para = new Parameter().WithName("P").WithParentContainer(cont);
            _fav  = new Parameter().WithName("F").WithParentContainer(cont);
            _spatialStructure.AddTopContainer(cont);
            A.CallTo(() => _favoriteRepository.All()).Returns(new[] { _entityPathResolver.PathFor(_fav) });
        }
Exemplo n.º 12
0
        public EditParameterPresenter(IEditParameterView view,
                                      IEditFormulaPresenter editValueFormulaPresenter,
                                      IParameterToParameterDTOMapper parameterMapper,
                                      IEditFormulaPresenter editRhsFormulaPresenter,
                                      IInteractionTaskContext interactionTaskContext,
                                      IGroupRepository groupRepository,
                                      IEditTaskFor <IParameter> editTasks,
                                      IInteractionTasksForParameter parameterTask,
                                      IContextSpecificReferencesRetriever contextSpecificReferencesRetriever,
                                      IFavoriteTask favoriteTask,
                                      IEditValueOriginPresenter editValueOriginPresenter,
                                      ITagsPresenter tagsPresenter,
                                      IDescriptorConditionListPresenter <IParameter> containerCriteriaPresenter)
            : base(view)
        {
            _editValueFormulaPresenter          = editValueFormulaPresenter;
            _parameterTask                      = parameterTask;
            _contextSpecificReferencesRetriever = contextSpecificReferencesRetriever;
            _favoriteTask               = favoriteTask;
            _editValueOriginPresenter   = editValueOriginPresenter;
            _tagsPresenter              = tagsPresenter;
            _containerCriteriaPresenter = containerCriteriaPresenter;
            _parameterMapper            = parameterMapper;
            _groupRepository            = groupRepository;
            _editTasks = editTasks;
            _editRHSFormulaPresenter = editRhsFormulaPresenter;
            _interactionTaskContext  = interactionTaskContext;
            _view.SetFormulaView(_editValueFormulaPresenter.BaseView);
            _view.AddRHSView(_editRHSFormulaPresenter.BaseView);
            _view.AddValueOriginView(_editValueOriginPresenter.BaseView);
            _view.AddTagsView(_tagsPresenter.BaseView);

            AddSubPresenters(editRhsFormulaPresenter, editValueFormulaPresenter, _editValueOriginPresenter, _tagsPresenter, _containerCriteriaPresenter);

            _editRHSFormulaPresenter.IsRHS = true;
            _editRHSFormulaPresenter.RemoveAllFormulaTypes();
            _editRHSFormulaPresenter.AddFormulaType <ConstantFormula>();
            _editRHSFormulaPresenter.AddFormulaType <ExplicitFormula>();
            _editRHSFormulaPresenter.SetDefaultFormulaType <ExplicitFormula>();
            ParameterBuildModes   = EnumHelper.AllValuesFor <ParameterBuildMode>();
            WarnOnBuildModeChange = true;
            _editValueOriginPresenter.ValueOriginUpdated += setValueOrigin;
            _editValueOriginPresenter.ShowCaption         = false;
        }
        protected override void Context()
        {
            _view = A.Fake <IEditParameterView>();
            _editFormulaPresenter    = A.Fake <IEditFormulaPresenter>();
            _parameterMapper         = A.Fake <IParameterToParameterDTOMapper>();
            _editRHSPresenter        = A.Fake <IEditFormulaPresenter>();
            _interactionTasksContext = A.Fake <IInteractionTaskContext>();
            _groupRepository         = A.Fake <IGroupRepository>();
            _editTasks                        = A.Fake <IEditTaskFor <IParameter> >();
            _favoriteTask                     = A.Fake <IFavoriteTask>();
            _parameterTask                    = A.Fake <IInteractionTasksForParameter>();
            _editValueOriginPresenter         = A.Fake <IEditValueOriginPresenter>();
            _tagsPresenter                    = A.Fake <ITagsPresenter>();
            _descriptorConditionListPresenter = A.Fake <IDescriptorConditionListPresenter <IParameter> >();

            _buildingBlock = A.Fake <IBuildingBlock>();

            sut = new EditParameterPresenter(
                _view,
                _editFormulaPresenter,
                _parameterMapper,
                _editRHSPresenter,
                _interactionTasksContext,
                _groupRepository,
                _editTasks,
                _parameterTask,
                new ContextSpecificReferencesRetriever(),
                _favoriteTask,
                _editValueOriginPresenter,
                _tagsPresenter,
                _descriptorConditionListPresenter)
            {
                BuildingBlock = _buildingBlock
            };

            _commandCollector = A.Fake <ICommandCollector>();
            sut.InitializeWith(_commandCollector);

            _parameter    = new Parameter().WithId("Para");
            _parameterDTO = new ParameterDTO(_parameter);
            A.CallTo(() => _parameterMapper.MapFrom(_parameter)).Returns(_parameterDTO);
        }
Exemplo n.º 14
0
        protected override void Context()
        {
            _view = A.Fake <IEditParameterView>();
            _editFormulaPresenter    = A.Fake <IEditFormulaPresenter>();
            _parameterMapper         = A.Fake <IParameterToParameterDTOMapper>();
            _editRHSPresenter        = A.Fake <IEditFormulaPresenter>();
            _entityTaks              = A.Fake <IEntityTask>();
            _interactionTasksContext = A.Fake <IInteractionTaskContext>();
            _groupRepository         = A.Fake <IGroupRepository>();
            _editTasks                = A.Fake <IEditTaskFor <IParameter> >();
            _favoriteTask             = A.Fake <IFavoriteTask>();
            _parameterTask            = A.Fake <IInteractionTasksForParameter>();
            _editValueOriginPresenter = A.Fake <IEditValueOriginPresenter>();
            sut = new EditParameterPresenter(_view, _editFormulaPresenter, _parameterMapper, _editRHSPresenter, _interactionTasksContext,
                                             _entityTaks, _groupRepository, _editTasks, _parameterTask, new ContextSpecificReferencesRetriever(), _favoriteTask, _editValueOriginPresenter)
            {
                BuildingBlock = A.Fake <IBuildingBlock>()
            };

            _commandCollector = A.Fake <ICommandCollector>();
            sut.InitializeWith(_commandCollector);
        }
Exemplo n.º 15
0
 protected override void Context()
 {
     _view            = A.Fake <IEditParametersInContainerView>();
     _formulaMapper   = A.Fake <IFormulaToFormulaBuilderDTOMapper>();
     _parameterMapper = A.Fake <IParameterToParameterDTOMapper>();
     _inteactionTasks = A.Fake <IInteractionTasksForParameter>();
     _distributeParameterPresenter = A.Fake <IEditDistributedParameterPresenter>();
     _parameterPresenter           = A.Fake <IEditParameterPresenter>();
     _parameter                 = new Parameter().WithId("P").WithName("P");
     _parameter.Visible         = true;
     _advancedParameter         = new Parameter().WithId("AP").WithName("AP");
     _quantityTask              = A.Fake <IQuantityTask>();
     _clipboardManager          = A.Fake <IClipboardManager>();
     _advancedParameter.Visible = false;
     _interactionTaskContext    = A.Fake <IInteractionTaskContext>();
     _editTask = A.Fake <IEditTaskFor <IParameter> >();
     _selectReferencePresenterFactory = A.Fake <ISelectReferencePresenterFactory>();
     _favoriteTask = A.Fake <IFavoriteTask>();
     sut           = new EditParametersInContainerPresenter(_view, _formulaMapper, _parameterMapper, _inteactionTasks,
                                                            _distributeParameterPresenter, _parameterPresenter, _quantityTask, _interactionTaskContext, _clipboardManager, _editTask, _selectReferencePresenterFactory, _favoriteTask);
     sut.InitializeWith(A.Fake <ICommandCollector>());
 }
Exemplo n.º 16
0
 public EditFavoritesInBuildindBlockPresenter(IEditFavoritesView view, IFavoriteRepository favoriteRepository, IEntityPathResolver entityPathResolver, IEditParameterListPresenter editParameterListPresenter, IFavoriteTask favoriteTask)
     : base(view, favoriteRepository, entityPathResolver, editParameterListPresenter, favoriteTask)
 {
 }
 public LoadFavoritesFromFileUICommand(IFavoriteTask favoriteTask)
 {
     _favoriteTask = favoriteTask;
 }
 public EditFavoritesInMoleculesPresenter(IEditFavoritesView view, IFavoriteRepository favoriteRepository, IEntityPathResolver entityPathResolver, IEditParameterListPresenter editParameterListPresenter, IFavoriteTask favoriteTask)
     : base(view, favoriteRepository, entityPathResolver, editParameterListPresenter, favoriteTask)
 {
     UpdateSpecialColumnsVisibility = _editParameterListPresenter.ConfigureForMolecule;
 }
Exemplo n.º 19
0
 public ParameterTask(IEntityPathResolver entityPathResolver, IExecutionContext executionContext, IFavoriteTask favoriteTask)
 {
     _entityPathResolver = entityPathResolver;
     _executionContext   = executionContext;
     _favoriteTask       = favoriteTask;
 }
Exemplo n.º 20
0
 public EditFavoritesInSpatialStructurePresenter(IEditFavoritesView view, IFavoriteRepository favoriteRepository, IEntityPathResolver entityPathResolver, IEditParameterListPresenter editParameterListPresenter, IFavoriteTask favoriteTask)
     : base(view, favoriteRepository, entityPathResolver, editParameterListPresenter, favoriteTask)
 {
 }
 public SaveFavoritesToFileUICommand(IFavoriteTask favoriteTask)
 {
     _favoriteTask = favoriteTask;
 }