public string Save() { var bonds = DataObject.Bonds.Where(bond => Isolation.Count(atom => bond.Atoms.Contains(atom)) == 2); var mol = DataObject.BondDataProvider != null ? new Molecule(Isolation.ToList(), bonds) : new Molecule(Isolation.ToList()); var folder = Path.GetDirectoryName(_path); var file = Path.GetFileNameWithoutExtension(_path); var createdFile = folder + "/" + file + "_isolation.mol2"; Mol2Exporter.Export(mol, createdFile); return(createdFile); }
private void Validate() { foreach (var bond in Bonds3D) { if (Isolation.Count(atom => bond.Bond.Atoms.Contains(atom)) != 2) { continue; } bond.Color = Colors.Green; bond.IsValid = true; } }