public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) { ICrystal crystal = chemModel.Crystal; if (crystal != null) { if (crystal.contains(atom)) { crystal.removeAtomAndConnectedElectronContainers(atom); } return; } ISetOfMolecules moleculeSet = chemModel.SetOfMolecules; if (moleculeSet != null) { SetOfMoleculesManipulator.removeAtomAndConnectedElectronContainers(moleculeSet, atom); } ISetOfReactions reactionSet = chemModel.SetOfReactions; if (reactionSet != null) { SetOfReactionsManipulator.removeAtomAndConnectedElectronContainers(reactionSet, atom); } }
public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons) { ICrystal crystal = chemModel.Crystal; if (crystal != null) { if (crystal.contains(electrons)) { crystal.removeElectronContainer(electrons); } return; } ISetOfMolecules moleculeSet = chemModel.SetOfMolecules; if (moleculeSet != null) { SetOfMoleculesManipulator.removeElectronContainer(moleculeSet, electrons); } ISetOfReactions reactionSet = chemModel.SetOfReactions; if (reactionSet != null) { SetOfReactionsManipulator.removeElectronContainer(reactionSet, electrons); } }