Пример #1
0
        /// <summary> Clones this <code>ChemModel</code> and its content.
        ///
        /// </summary>
        /// <returns>  The cloned object
        /// </returns>
        public override System.Object Clone()
        {
            ChemModel clone = (ChemModel)base.Clone();

            // clone the content
            if (setOfMolecules != null)
            {
                clone.setOfMolecules = (SetOfMolecules)((SetOfMolecules)setOfMolecules).Clone();
            }
            else
            {
                clone.setOfMolecules = null;
            }
            if (setOfReactions != null)
            {
                clone.setOfReactions = (ISetOfReactions)((SetOfReactions)setOfReactions).Clone();
            }
            else
            {
                clone.setOfReactions = null;
            }
            if (crystal != null)
            {
                clone.crystal = (Crystal)((Crystal)crystal).Clone();
            }
            else
            {
                clone.crystal = null;
            }
            if (ringSet != null)
            {
                clone.ringSet = (RingSet)((RingSet)ringSet).Clone();
            }
            else
            {
                clone.ringSet = null;
            }
            return(clone);
        }
Пример #2
0
 /// <summary>  Grows the chemModel array by a given size.
 ///
 /// </summary>
 /// <seealso cref="growArraySize">
 /// </seealso>
 protected internal virtual void growChemModelArray()
 {
     ChemModel[] newchemModels = new ChemModel[chemModels.Length + growArraySize];
     Array.Copy(chemModels, 0, newchemModels, 0, chemModels.Length);
     chemModels = newchemModels;
 }