Class to manage a list of Molecule. This object is used by Graphics control rather than Molecule to manage reaction sheme.

Namespace:  Hyleos.Chemistry
Assembly:  Hyleos.Chemistry (in Hyleos.Chemistry.dll) Version: 1.0.9.4 (1.0.9.4)

Syntax

C#
[SerializableAttribute]
public sealed class Molecules : BaseObject
Visual Basic (Declaration)
<SerializableAttribute> _
Public NotInheritable Class Molecules _
	Inherits BaseObject
Visual C++
[SerializableAttribute]
public ref class Molecules sealed : public BaseObject

Remarks

An empty Molecule object is inserted by the constructor

Examples

Exemple using Rxn file :
CopyC#
 // include Hyleos Assembly
 using Hyleos.Chemistry;

try
{
    // Create Molecules object
    Molecules chemistry = new Molecules();
    // Read and analyse contents of Rxn File
    MDL.ReadRxnFile(chemistry, filename);
    // Check if we have at least one Molecule object
    if (chemistry.CountMolecules > 0)
    {
        /** 
         * your code
         */
        // Check if we are working with a reaction scheme
        if (mols.ReactionScheme)
        {
            // Loop over Reactants
            if (molecules.CountReactants > 0)
            {
                foreach (Molecule molecule in molecules.Reactant)
                {
                    // 
                }
            }
            // Loop over Product(s)
            if (molecules.CountProducts > 0)
            {
                foreach (Molecule molecule in molecules.Product)
                {
                    // 
                }
            }
        }
        // Loop over full reaction scheme
        foreach (Molecule Molecule in chemistry.Item)
        {
            // work with the current Molecule object
        }
    }
}
catch(Exception e)
{
    // manage error
}

Inheritance Hierarchy

System..::.Object
  Hyleos.Common..::.BaseObject
    Hyleos.Chemistry..::.Molecules

See Also