コード例 #1
0
 public SetSpeciesInSpeciesDependentEntityCommand(ISpeciesDependentEntity entity, Species species, IExecutionContext context)
 {
     _entity         = entity;
     _entityId       = entity.Id;
     BuildingBlockId = context.BuildingBlockIdContaining(entity);
     ObjectType      = context.TypeFor(entity);
     CommandType     = PKSimConstants.Command.CommandTypeEdit;
     _oldSpecies     = entity.Species;
     _newSpecies     = species;
     Description     = PKSimConstants.Command.SetSpeciesInSpeciesDependentEntityDescription(context.TypeFor(_entity), entity.Name, _oldSpecies.Name, _newSpecies.Name);
     context.UpdateBuildingBlockPropertiesInCommand(this, context.BuildingBlockContaining(entity));
 }
コード例 #2
0
 protected override void ClearReferences()
 {
     _entity     = null;
     _newSpecies = null;
     //do not clear ref for old species, as old species will be used in the rollback command
 }
コード例 #3
0
 public override void RestoreExecutionData(IExecutionContext context)
 {
     base.RestoreExecutionData(context);
     _entity = context.Get <ISpeciesDependentEntity>(_entityId);
 }