public void Rename <TBuildingBlock>(TBuildingBlock buildingBlockToRename) where TBuildingBlock : class, IPKSimBuildingBlock { if (buildingBlockToRename.IsAnImplementationOf <Compound>()) { var simulationsUsingBuildingBlockToDelete = _buildingBlockInSimulationManager.SimulationsUsing(buildingBlockToRename).ToList(); if (simulationsUsingBuildingBlockToDelete.Any()) { throw new CannotRenameCompoundException(buildingBlockToRename.Name, simulationsUsingBuildingBlockToDelete); } } Load(buildingBlockToRename); AddCommandToHistory(_entityTask.Rename(buildingBlockToRename)); }
public void RenameMolecule(IndividualMolecule molecule) { AddCommand(_entityTask.Rename(molecule)); editMolecule(molecule); }