Exemple #1
0
        protected override void UpdateControls(int indexThatWillHaveFocus)
        {
            UpdateViewStatus();

            //we are on the subject selection. Next only enable if the model /subject selection ok
            if (indexThatWillHaveFocus == SimulationItems.Model.Index)
            {
                _view.NextEnabled = PresenterAt(SimulationItems.Model).CanClose;
            }

            //we are on the compound selection. Next only enable if the compound selection ok
            else if (indexThatWillHaveFocus == SimulationItems.Compounds.Index)
            {
                _view.NextEnabled = PresenterAt(SimulationItems.Compounds).CanClose;
            }

            else
            {
                _view.NextEnabled = true;
            }

            var simulationCreated = PresenterAt(SimulationItems.Model).SimulationCreated;

            AllSimulationItemsAfterModel.Each(x => _view.SetControlEnabled(x, simulationCreated));

            _view.OkEnabled = CanClose && simulationCreated;
        }
        public override void ModelConfigurationDone()
        {
            if (PresenterAt(SimulationItems.Model).SimulationCreated)
            {
                return;
            }

            SaveBuildingBlocksConfiguration();

            PresenterAt(SimulationItems.Model).CreateSimulation();
            AllSimulationItemsAfterModel.Each(x => PresenterAt(x).EditSimulation(Simulation, CreationMode.New));
        }
        public IPKSimCommand Create()
        {
            _simulationPropertiesDTO = _buildingBlockDTOFactory.CreateFor <Simulation>();
            _view.BindToProperties(_simulationPropertiesDTO);

            _view.ActivateControl(SimulationItems.Model);
            _view.EnableControl(SimulationItems.Model);
            AllSimulationItemsAfterModel.Each(x => _view.DisableControl(x));
            SetWizardButtonEnabled(SimulationItems.Model);
            _view.Display();

            if (_view.Canceled)
            {
                return(new PKSimEmptyCommand());
            }

            return(new PKSimMacroCommand());
        }
 private void editSimulation(Simulation simulation)
 {
     AllSimulationItemsAfterModel.Each(x => PresenterAt(x).EditSimulation(simulation, _creationMode));
 }