Пример #1
0
        public EditEventBuilderPresenter(IEditEventBuilderView view, IEventBuilderToEventBuilderDTOMapper eventToEventBuilderMapper,
                                         IFormulaToFormulaBuilderDTOMapper formulaToDTOFormulaMapper,
                                         IEditTaskFor <IEventBuilder> editTasks, IEditParametersInContainerPresenter editParametersPresenter,
                                         IInteractionTasksForChildren <IEventBuilder, IEventAssignmentBuilder> interactionTasksForEventAssignmentBuilder,
                                         IEditExplicitFormulaPresenter editFormulaPresenter, IMoBiContext context,
                                         ISelectReferenceAtEventPresenter selectReferencePresenter,
                                         IMoBiApplicationController applicationController, IDialogCreator dialogCreator)
            : base(view)
        {
            _selectReferencePresenter = selectReferencePresenter;
            _applicationController    = applicationController;
            _dialogCreator            = dialogCreator;
            _context = context;
            _editFormulaPresenter = editFormulaPresenter;
            _interactionTasksForEventAssignmentBuilder = interactionTasksForEventAssignmentBuilder;
            _eventToEventBuilderMapper = eventToEventBuilderMapper;
            _formulaToDTOFormulaMapper = formulaToDTOFormulaMapper;
            _editTasks = editTasks;
            _editParametersPresenter = editParametersPresenter;

            _view.SetParametersView(editParametersPresenter.BaseView);
            _formulaPropertyName = _eventBuilder.PropertyName(x => x.Formula);

            AddSubPresenters(_editFormulaPresenter, _editParametersPresenter, _selectReferencePresenter);
        }
 public AddNewPassiveTransportToApplicationBuilderUICommand(IInteractionTasksForChildren <IApplicationBuilder, ITransportBuilder> interactionTasks,
                                                            IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasks       = interactionTasks;
     _context                = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
 protected override void Context()
 {
     _view = A.Fake <IEditEventBuilderView>();
     _eventBuilderMapper     = A.Fake <IEventBuilderToEventBuilderDTOMapper>();
     _formulaMapper          = A.Fake <IFormulaToFormulaBuilderDTOMapper>();
     _eventBuilderTasks      = A.Fake <IEditTaskFor <IEventBuilder> >();
     _parameterPresenter     = A.Fake <IEditParametersInContainerPresenter>();
     _assingmentBuilderTasks = A.Fake <IInteractionTasksForChildren <IEventBuilder, IEventAssignmentBuilder> >();
     _formulaPresenter       = A.Fake <IEditExplicitFormulaPresenter>();
     _context = A.Fake <IMoBiContext>();
     _selectReferencePresenter = A.Fake <ISelectReferenceAtEventPresenter>();
     _applicationController    = A.Fake <IMoBiApplicationController>();
     _dialogCreator            = A.Fake <IDialogCreator>();
     sut = new EditEventBuilderPresenter(_view, _eventBuilderMapper, _formulaMapper, _eventBuilderTasks, _parameterPresenter, _assingmentBuilderTasks, _formulaPresenter, _context, _selectReferencePresenter, _applicationController, _dialogCreator);
 }
 protected override void Context()
 {
     _view = A.Fake <IEditExplicitFormulaView>();
     _explicitFormulaMapper  = A.Fake <IExplicitFormulaToExplicitFormulaDTOMapper>();
     _activeSubjectRetriever = A.Fake <IActiveSubjectRetriever>();
     _context                    = A.Fake <IMoBiContext>();
     _formulaChecker             = A.Fake <ICircularReferenceChecker>();
     _dialogCreator              = A.Fake <IDialogCreator>();
     _interactionTask            = A.Fake <IInteractionTasksForChildren <IFormula, IFormulaUsablePath> >();
     _reactionDimensionRetriever = A.Fake <IReactionDimensionRetriever>();
     _displayUnitRetriever       = A.Fake <IDisplayUnitRetriever>();
     _dimensionFactory           = A.Fake <IDimensionFactory>();
     _userSettings               = A.Fake <IUserSettings>();
     _viewItemContextMenuFactory = A.Fake <IViewItemContextMenuFactory>();
     _moBiFormulaTask            = A.Fake <IMoBiFormulaTask>();
     sut = new EditExplicitFormulaPresenter(_view, _explicitFormulaMapper, _activeSubjectRetriever, _context, _formulaChecker,
                                            _moBiFormulaTask, _reactionDimensionRetriever, _displayUnitRetriever, _viewItemContextMenuFactory, _userSettings, _dimensionFactory);
 }
Пример #5
0
        protected override void Context()
        {
            base.Context();
            _reactionBuildingBlock = new MoBiReactionBuildingBlock
            {
                DiagramModel   = new DiagramModel(),
                DiagramManager = new MoBiReactionDiagramManager()
            };

            _moBiReactionDiagramManager = _reactionBuildingBlock.DiagramManager.DowncastTo <IReactionDiagramManager <IMoBiReactionBuildingBlock> >();

            _moBiReactionDiagramManager.InitializeWith(_reactionBuildingBlock, A.Fake <IDiagramOptions>());

            _molecule = new MoleculeBuilder().WithId("moleculeId").WithName("moleculeName");
            _reaction = new ReactionBuilder().WithId("reactionId");
            _reaction.AddEduct(new ReactionPartnerBuilder(_molecule.Name, 1.0));
            _reactionBuildingBlock.Add(_reaction);
            _moBiReactionDiagramManager.AddObjectBase(_reaction);
            _moBiReactionDiagramManager.AddMolecule(_reaction, "moleculeName");
            _moleculeNode           = _moBiReactionDiagramManager.GetMoleculeNodes("moleculeName").FirstOrDefault();
            _reactionNode           = _moBiReactionDiagramManager.PkModel.DiagramModel.GetAllChildren <ReactionNode>().FirstOrDefault();
            _interactionTask        = A.Fake <IInteractionTasksForChildren <IMoBiReactionBuildingBlock, IReactionBuilder> >();
            _activeSubjectRetriever = A.Fake <IActiveSubjectRetriever>();

            var reactionLink = new ReactionLink();

            reactionLink.Initialize(ReactionLinkType.Educt, _reactionNode, _moleculeNode);

            sut.Edit(_reactionBuildingBlock);

            var removeReactionCommand = new RemoveCommandFor <IMoBiReactionBuildingBlock, IReactionBuilder>(_interactionTask, _moBiContext, _activeSubjectRetriever);

            A.CallTo(() => _moBiContext.Get <IReactionBuilder>(_reaction.Id)).Returns(_reaction);
            A.CallTo(() => _moBiContext.Resolve <RemoveCommandFor <IMoBiReactionBuildingBlock, IReactionBuilder> >()).Returns(removeReactionCommand);
            A.CallTo(() => _activeSubjectRetriever.Active <IBuildingBlock>()).Returns(_reactionBuildingBlock);
            A.CallTo(() => _interactionTask.Remove(_reaction, _reactionBuildingBlock, _reactionBuildingBlock, A <bool> ._)).Invokes(x => _reactionBuildingBlock.Remove(_reaction));
        }
        public EditApplicationBuilderPresenter(IEditApplicationBuilderView view, IEditTaskFor <IApplicationBuilder> editTasks,
                                               IFormulaToFormulaBuilderDTOMapper formulaToDTOFormulaMapper,
                                               IApplicationBuilderToApplicationBuilderDTOMapper applicationBuilderToDTOApllicationBuilderMapper,
                                               IInteractionTasksForChildren <IApplicationBuilder, IApplicationMoleculeBuilder> interactionTasksForApplicationMoleculeBuilder,
                                               IViewItemContextMenuFactory viewItemContextMenuFactory,
                                               IEditParametersInContainerPresenter editParametersInContainerPresenter, IMoBiContext context,
                                               IDescriptorConditionListPresenter <IApplicationBuilder> descriptorConditionListPresenter, IApplicationController applicationController)
            : base(view)
        {
            _descriptorConditionListPresenter = descriptorConditionListPresenter;
            _applicationController            = applicationController;
            _context = context;
            _editParametersInContainerPresenter = editParametersInContainerPresenter;
            _view.SetParametersView(_editParametersInContainerPresenter.BaseView);
            _viewItemContextMenuFactory = viewItemContextMenuFactory;
            _interactionTasksForApplicationMoleculeBuilder   = interactionTasksForApplicationMoleculeBuilder;
            _applicationBuilderToDTOApllicationBuilderMapper = applicationBuilderToDTOApllicationBuilderMapper;
            _formulaToDTOFormulaMapper = formulaToDTOFormulaMapper;
            _editTasks = editTasks;
            _view.AddDescriptorConditionListView(_descriptorConditionListPresenter.View);
            _formulaPropertyName = MoBiReflectionHelper.PropertyName <IApplicationMoleculeBuilder>(x => x.Formula);

            AddSubPresenters(_editParametersInContainerPresenter, _descriptorConditionListPresenter);
        }
 public RemoveCommandForContainerAtEventGroup(IInteractionTasksForChildren <IEventGroupBuilder, IContainer> interactionTasksContainerInEventGroup, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasksContainerInEventGroup = interactionTasksContainerInEventGroup;
     _context = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
 public RemoveCommandForContainerAtMolecule(IInteractionTasksForChildren <IMoleculeBuilder, InteractionContainer> interactionTasksForInteractionContainer, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasksForInteractionContainer = interactionTasksForInteractionContainer;
     _context = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
Пример #9
0
 public AddExistingFromTemplateCommandFor(IInteractionTasksForChildren <TParent, TChild> interactionTasks, IActiveSubjectRetriever activeSubjectRetriever, IMoBiContext context)
     : base(activeSubjectRetriever, context, interactionTasks.AddExistingTemplate)
 {
 }
Пример #10
0
 public AddNewCommandFor(IInteractionTasksForChildren <TParent, TChild> interactionTasks, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasks       = interactionTasks;
     _activeSubjectRetriever = activeSubjectRetriever;
     _context = context;
 }
Пример #11
0
 public AddExistingFromTemplateTopContainerCommand(IInteractionTasksForChildren <IMoBiSpatialStructure, IContainer> interactionTasks, IActiveSubjectRetriever activeSubjectRetriever, IMoBiContext context)
     : base(interactionTasks, activeSubjectRetriever, context)
 {
 }
Пример #12
0
 public RemoveSimulationUICommand(IMoBiContext context, IInteractionTasksForChildren <IMoBiProject, IMoBiSimulation> simulationTasks, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _context                = context;
     _simulationTasks        = simulationTasks;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
Пример #13
0
 public RemoveCommandForContainer(IInteractionTasksForChildren <IContainer, IContainer> interactionTasksContainer, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasksContainer = interactionTasksContainer;
     _context = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
Пример #14
0
 public RemoveEventBuilderFromEventGroupBuilderUICommand(IInteractionTasksForChildren <IEventGroupBuilder, IEventGroupBuilder> interactionTasks, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasks       = interactionTasks;
     _context                = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }
Пример #15
0
 public RemoveApplicationMoleculeBuilderUICommand(IInteractionTasksForChildren <IApplicationBuilder, IApplicationMoleculeBuilder> interactionTasks, IMoBiContext context, IActiveSubjectRetriever activeSubjectRetriever)
 {
     _interactionTasks       = interactionTasks;
     _context                = context;
     _activeSubjectRetriever = activeSubjectRetriever;
 }