public RenameDataSourceCommand(PKSim.Core.Model.CompoundProcess compoundProcess, string newDataSource, IExecutionContext context)
 {
     _processId       = compoundProcess.Id;
     BuildingBlockId  = context.BuildingBlockIdContaining(compoundProcess);
     _newDataSource   = newDataSource;
     _compoundProcess = compoundProcess;
     ObjectType       = context.TypeFor(compoundProcess);
     CommandType      = PKSimConstants.Command.CommandTypeEdit;
     context.UpdateBuildinBlockProperties(this, context.BuildingBlockContaining(compoundProcess));
 }
示例#2
0
        protected override void Context()
        {
            _executionContext = A.Fake <IExecutionContext>();
            _project          = new PKSimProject();
            A.CallTo(() => _executionContext.CurrentProject).Returns(_project);

            _compound = new Compound().WithId("Tralala").WithName("Tralala");
            _project.AddBuildingBlock(_compound);

            _proc = new EnzymaticProcess().WithName("ActProc1");

            var serializedStream = new byte[1];

            A.CallTo(() => _executionContext.Serialize(_proc)).Returns(serializedStream);
            A.CallTo(() => _executionContext.Deserialize <PKSim.Core.Model.CompoundProcess>(serializedStream)).Returns(_proc);

            A.CallTo(() => _executionContext.Get <Compound>(_compound.Id)).Returns(_compound);
            A.CallTo(() => _executionContext.Get <PKSim.Core.Model.CompoundProcess>(_proc.Id)).Returns(_proc);

            sut = new AddProcessToCompoundCommand(_proc, _compound, _executionContext);
        }
示例#3
0
 public virtual void RemoveProcess(CompoundProcess process)
 {
     RemoveChild(process);
 }
示例#4
0
 public virtual void AddProcess(CompoundProcess process)
 {
     Add(process);
 }
 public override void RestoreExecutionData(IExecutionContext context)
 {
     base.RestoreExecutionData(context);
     _compoundProcess = context.Get <PKSim.Core.Model.CompoundProcess>(_processId);
 }
 protected override void ClearReferences()
 {
     _compoundProcess = null;
 }