Ejemplo 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;
 }
Ejemplo n.º 2
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 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;
 }
 public EditDistributedParameterPresenter(IEditDistributedParameterView view, IEditTaskFor <IParameter> editTasks,
                                          IMoBiContext context, IDistributedParameterToDistributedParameterDTOMapper distributedParameterMapper,
                                          IDistributionFormulaFactory distributionFormulaFactory, IQuantityTask quantityTask, IFormulaToFormulaBuilderDTOMapper formulaMapper,
                                          IMoBiFormulaTask formulaTask, IParameterFactory parameterFactory, IInteractionTasksForParameter parameterTask) : base(view)
 {
     _editTasks = editTasks;
     _distributionFormulaFactory = distributionFormulaFactory;
     _quantityTask               = quantityTask;
     _formulaMapper              = formulaMapper;
     _formulaTask                = formulaTask;
     _parameterFactory           = parameterFactory;
     _parameterTask              = parameterTask;
     _distributedParameterMapper = distributedParameterMapper;
     _context = context;
 }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
0
        protected override void Context()
        {
            _commandCollector           = A.Fake <ICommandCollector>();
            _view                       = A.Fake <IEditDistributedParameterView>();
            _editTask                   = A.Fake <IEditTaskFor <IParameter> >();
            _context                    = A.Fake <IMoBiContext>();
            _distributedParameterMapper = A.Fake <IDistributedParameterToDistributedParameterDTOMapper>();
            _distributionFormulaFactory = A.Fake <IDistributionFormulaFactory>();
            _quantityTask               = A.Fake <IQuantityTask>();
            _formulaMapper              = A.Fake <IFormulaToFormulaBuilderDTOMapper>();
            _formulaTask                = A.Fake <IMoBiFormulaTask>();
            _parameterFactory           = A.Fake <IParameterFactory>();
            _parameterTask              = A.Fake <IInteractionTasksForParameter>();

            sut = new EditDistributedParameterPresenter(_view, _editTask, _context, _distributedParameterMapper, _distributionFormulaFactory, _quantityTask, _formulaMapper,
                                                        _formulaTask, _parameterFactory, _parameterTask);

            sut.InitializeWith(_commandCollector);
        }
        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);
        }
Ejemplo n.º 8
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>());
 }
Ejemplo n.º 9
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);
        }