コード例 #1
0
        public void TestGetAllChemObjects_IReactionSet()
        {
            var allObjects = ReactionManipulator.GetAllChemObjects(reaction);

            // does not recurse beyond the IAtomContainer, so:
            // reaction, 2xreactant, 1xproduct
            Assert.AreEqual(4, allObjects.Count());
        }
コード例 #2
0
        public static IEnumerable <IChemObject> GetAllChemObjects(IReactionSet set)
        {
            yield return(set);

            foreach (var reaction in set)
            {
                foreach (var o in ReactionManipulator.GetAllChemObjects(reaction))
                {
                    yield return(o);
                }
            }
            yield break;
        }
コード例 #3
0
        public static List <IChemObject> GetAllChemObjects(IReactionSet set)
        {
            List <IChemObject> list = new List <IChemObject>
            {
                set
            };

            foreach (var reaction in set)
            {
                list.AddRange(ReactionManipulator.GetAllChemObjects(reaction));
            }
            return(list);
        }