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)); }
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 }
public override void RestoreExecutionData(IExecutionContext context) { base.RestoreExecutionData(context); _entity = context.Get <ISpeciesDependentEntity>(_entityId); }