Example #1
0
 public override void InitializeWith(ICommandCollector commandCollector)
 {
     base.InitializeWith(commandCollector);
     _paramEditPresenter.InitializeWith(commandCollector);
 }
Example #2
0
        public bool CheckUsagesFor(string newName, string oldName, IObjectBase renamedObject, ICommandCollector commandCollector)
        {
            if (renamedObject.IsAnImplementationOf <IModelCoreSimulation>())
            {
                return(changeUsagesInSumulation(newName, renamedObject.DowncastTo <IModelCoreSimulation>(), commandCollector));
            }

            return(checkUsagesInBuildingBlocks(newName, renamedObject, commandCollector, oldName));
        }
Example #3
0
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     _allSelectionPresenter.Each(x => x.InitializeWith(commandRegister));
 }
        private IModalPresenter createModalPresenter(ICommandCollectorPresenter editSubPresenter, ICommandCollector commandCollector)
        {
            var modalPresenter = _container.Resolve <IModalPresenter>();

            editSubPresenter.InitializeWith(commandCollector);
            modalPresenter.Encapsulate(editSubPresenter);
            return(modalPresenter);
        }
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     _editMoleculeParameters.InitializeWith(CommandCollector);
 }
        public override bool EditEntityModal(T entity, IEnumerable <IObjectBase> existingObjectsInParent, ICommandCollector commandCollector, IBuildingBlock buildingBlock)
        {
            var forbiddenNames = GetForbiddenNamesWithoutSelf(entity, existingObjectsInParent);
            var name           = _interactionTaskContext.DialogCreator.AskForInput(AppConstants.Dialog.AskForNewName(ObjectName),
                                                                                   AppConstants.Captions.NewWindow(ObjectName), string.Empty, forbiddenNames);

            if (name.IsNullOrEmpty())
            {
                return(false);
            }

            entity.Name = name;
            return(true);
        }
 protected override void Because()
 {
     _commandCollector = A.Fake <ICommandCollector>();
     sut.InitializeWith(_commandCollector);
 }
Example #8
0
 public override void InitializeWith(ICommandCollector commandCollector)
 {
     base.InitializeWith(commandCollector);
     eventSettingsPresenter.TemplateChanged += (o, e) => templateChanged(e);
 }
Example #9
0
 protected override IModalPresenter GetCreateViewFor(IParameter entity, ICommandCollector command)
 {
     return(_applicationController.GetCreateParameterViewFor(entity, entity.ParentContainer, command));
 }
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     dataSelectionPresenter.SimulationAdded   += (o, e) => simulationAdded(e);
     dataSelectionPresenter.SimulationRemoved += (o, e) => simulationRemoved(e);
 }
Example #11
0
 public void DoImport(Model sbmlModel, IMoBiProject moBiProject, SBMLInformation sbmlInformation, ICommandCollector command)
 {
     _sbmlProject     = moBiProject;
     _sbmlInformation = sbmlInformation;
     _command         = command;
     try
     {
         Import(sbmlModel);
     }
     finally
     {
         _sbmlProject     = null;
         _sbmlInformation = null;
         _command         = null;
     }
 }
 public override void ReleaseFrom(IEventPublisher eventPublisher)
 {
     base.ReleaseFrom(eventPublisher);
     CommandCollector = null;
 }
 public virtual void InitializeWith(ICommandCollector commandCollector)
 {
     CommandCollector = commandCollector;
     _subPresenterManager.InitializeWith(this);
 }
Example #14
0
 public override void InitializeWith(ICommandCollector commandCollector)
 {
     base.InitializeWith(commandCollector);
     _parameterGroupsPresenter.InitializeWith(commandCollector);
     _parameterGroupsPresenter.StatusChanged += OnStatusChanged;
 }
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     PresenterAt(SimulationSettingsItems.OutputSchema).DowncastTo <IEditOutputSchemaPresenter>().ShowGroupCaption = false;
     PresenterAt(SimulationSettingsItems.Solver).DowncastTo <IEditSolverSettingsPresenter>().ShowGroupCaption     = false;
 }
Example #16
0
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     _subPresenterItemManager.InitializeWith(this, _subPresenterItems);
 }
 protected override void Context()
 {
    base.Context();
    _commandRegister = A.Fake<ICommandCollector>();
 }
Example #18
0
        private void addBuildConfigurationToProject(IMoBiProject project, IMoBiBuildConfiguration config, ICommandCollector commandCollector)
        {
            var copyMolecules = addToProject(commandCollector, createForProject(project.MoleculeBlockCollection, config.MoleculesInfo));

            if (copyMolecules == null)
            {
                copyMolecules = config.Molecules;
            }

            var copySpatialStructure = addToProject(commandCollector, createForProject(project.SpatialStructureCollection, config.SpatialStructureInfo));

            if (copySpatialStructure == null)
            {
                copySpatialStructure = config.MoBiSpatialStructure;
            }

            addToProject(commandCollector, createForProject(project.ReactionBlockCollection, config.ReactionsInfo));
            addToProject(commandCollector, createForProject(project.PassiveTransportCollection, config.PassiveTransportsInfo));
            addToProject(commandCollector, createForProject(project.ObserverBlockCollection, config.ObserversInfo));
            addToProject(commandCollector, createForProject(project.SimulationSettingsCollection, config.SimulationSettingsInfo));
            addToProject(commandCollector, createForProject(project.EventBlockCollection, config.EventGroupsInfo));

            var psv = addToProject(commandCollector, createForProject(project.ParametersStartValueBlockCollection, config.ParameterStartValuesInfo));

            if (psv != null)
            {
                updateTemplateBuildingBlockIds(psv, copyMolecules.Id, copySpatialStructure.Id, config.ParameterStartValuesInfo.BuildingBlock);
            }

            var msv = addToProject(commandCollector, createForProject(project.MoleculeStartValueBlockCollection, config.MoleculeStartValuesInfo));

            if (msv != null)
            {
                updateTemplateBuildingBlockIds(msv, copyMolecules.Id, copySpatialStructure.Id, config.MoleculeStartValuesInfo.BuildingBlock);
            }
        }
 public OpenSingleStartPresenterInvoker(IApplicationController applicationController, ICoreWorkspace commandCollector)
 {
     _applicationController = applicationController;
     _commandCollector      = commandCollector;
 }
 protected override void Context()
 {
     base.Context();
     _commandCollector = A.Fake <ICommandCollector>();
     A.CallTo(() => _applicationController.HasPresenterOpenedFor(_individualSimulation)).Returns(false);
 }
 public IModalPresenter GetCreateViewForTransport <TPresenter>(ITransportBuilder transportBuilder, ICommandCollector commandCollector) where TPresenter : ICommandCollectorPresenter
 {
     return(createModalPresenter(Start <TPresenter>(), commandCollector));
 }
 public override void InitializeWith(ICommandCollector initializer)
 {
     base.InitializeWith(initializer);
     PresenterAt(TimeProfileItems.PKParameterSpecification).ScalingVisible = false;
     PresenterAt(TimeProfileItems.ParameterSelection).ScalingVisible       = false;
 }
        public IModalPresenter GetCreateParameterViewFor <T, TParent>(T objectToEdit, TParent parent, ICommandCollector commandCollector)
        {
            var modalPresenter = createModalPresenter(Start <IEditParameterPresenter>(), commandCollector);

            modalPresenter.Text = AppConstants.Captions.NewWindow(_objectTypeResolver.TypeFor <T>());
            return(modalPresenter);
        }
Example #24
0
 public override void InitializeWith(ICommandCollector commandCollector)
 {
     base.InitializeWith(commandCollector);
     _dynamicParameterPresenter.InitializeWith(commandCollector);
 }
Example #25
0
        private static bool changeUsagesInSumulation(string newName, IModelCoreSimulation simulation, ICommandCollector commandCollector)
        {
            commandCollector.AddCommand(new RenameObjectBaseCommand(simulation.Model, newName, null));
            commandCollector.AddCommand(new RenameModelCommand(simulation.Model, newName));
            // Dont rename core Container to avoid refernce Corruption

            return(true);
        }
Example #26
0
 public override void InitializeWith(ICommandCollector commandRegister)
 {
     base.InitializeWith(commandRegister);
     _subPresenterItemManager.AllSubPresenters.Each(presenter => presenter.StatusChanged += subPresenterChanged);
 }
Example #27
0
        private bool checkUsagesInBuildingBlocks(string newName, IObjectBase renamedObject, ICommandCollector commandCollector, string oldName)
        {
            var buildingBlocks    = _context.CurrentProject.AllBuildingBlocks();
            var possibleChangings = new List <IStringChange>();

            foreach (var buildingBlock in buildingBlocks)
            {
                possibleChangings.AddRange(_checkNamesVisitor.GetPossibleChangesFrom(renamedObject, newName, buildingBlock, oldName));
            }

            if (!possibleChangings.Any())
            {
                return(true);
            }

            using (var selectRenamingsPresenter = _applicationController.Start <ISelectRenamingPresenter>())
            {
                selectRenamingsPresenter.InitializeWith(possibleChangings);

                if (renamedObject.IsAnImplementationOf <IBuildingBlock>())
                {
                    selectRenamingsPresenter.SetCheckedStateForAll(checkedState: false);
                }

                if (!selectRenamingsPresenter.SelectRenamings())
                {
                    return(false);
                }

                var commands = selectRenamingsPresenter.SelectedCommands();
                commands.Each(commandCollector.AddCommand);
                return(true);
            }
        }
 public virtual TPresenter Open <TPresenter, TSubject>(TSubject subject, ICommandCollector commandCollector) where TPresenter : ISingleStartPresenter <TSubject>
 {
     return(Open(subject, commandCollector).DowncastTo <TPresenter>());
 }
Example #29
0
 public override void InitializeWith(ICommandCollector commandCollector)
 {
     base.InitializeWith(commandCollector);
     _molWeightHalogensPresenter.InitializeWith(commandCollector);
 }
 protected virtual IModalPresenter GetCreateViewFor(T entity, ICommandCollector command)
 {
     return(_applicationController.GetCreateViewFor(entity, command));
 }