示例#1
0
        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));
        }
示例#2
0
 public void RenameMolecule(IndividualMolecule molecule)
 {
     AddCommand(_entityTask.Rename(molecule));
     editMolecule(molecule);
 }