コード例 #1
0
        public void TestSetAtomProperties_IAtomContainerSet_Object_Object()
        {
            string key   = "key";
            string value = "value";

            MoleculeSetManipulator.SetAtomProperties(som, key, value);
            Assert.AreEqual(value, atomInMol1.GetProperty <string>(key));
            Assert.AreEqual(value, atomInMol2.GetProperty <string>(key));
        }
コード例 #2
0
 /// <summary>
 /// Sets the AtomProperties of all Atoms inside an IChemModel.
 /// </summary>
 /// <param name="chemModel">The IChemModel object.</param>
 /// <param name="propKey">The key of the property.</param>
 /// <param name="propVal">The value of the property.</param>
 public static void SetAtomProperties(IChemModel chemModel, string propKey, object propVal)
 {
     if (chemModel.MoleculeSet != null)
     {
         MoleculeSetManipulator.SetAtomProperties(chemModel.MoleculeSet, propKey, propVal);
     }
     if (chemModel.ReactionSet != null)
     {
         ReactionSetManipulator.SetAtomProperties(chemModel.ReactionSet, propKey, propVal);
     }
     if (chemModel.Crystal != null)
     {
         AtomContainerManipulator.SetAtomProperties(chemModel.Crystal, propKey, propVal);
     }
 }