using System; using System.Reflection; using ChemAxon.JNI; namespace chemaxon.struc { /// /// Extension of the chemaxon.struc.MolBond class. /// public class MolBondExt : MolBond { /// /// Default constructor. /// protected MolBondExt() : base() { } /// /// Construct a single bond between two atoms. /// /// /// public MolBondExt(MolAtom a1, MolAtom a2) : base(a1, a2) { } /// /// Construct a bond between two atoms. /// /// /// /// public MolBond​Ext(MolAtom a1, MolAtom a2, int f) : base(a1, a2, f) { } /// /// Copy constructor. /// It copies the original chemaxon.struc.MolBond object by its Java object. /// /// public MolBondExt(MolBond bond) : base(bond.JavaObject) { } /// /// Overwrites the clone function. /// /// public new object clone() { return this.CallMethod(MethodBase.GetCurrentMethod()); } /// /// Extends the original chemaxon.struc.MolBond class with the missing /// getAtom1 function. /// /// public virtual MolAtom getAtom1() { return this.CallMethod(MethodBase.GetCurrentMethod()); } /// /// Extends the original chemaxon.struc.MolBond class with the missing /// getAtom2 function. /// /// public virtual MolAtom getAtom2() { return this.CallMethod(MethodBase.GetCurrentMethod()); } /// /// Extends the original chemaxon.struc.MolBond class with the missing /// getLength function. /// /// public virtual double getLength() { return this.CallMethod(MethodBase.GetCurrentMethod()); } /// /// Extends the original chemaxon.struc.MolBond class with the missing /// cloneBond​ function. /// /// /// /// public MolBond cloneBond​(MolAtom a1, MolAtom a2) { return this.CallMethod(MethodBase.GetCurrentMethod(), a1, a2); } /// /// Extends the original chemaxon.struc.MolBond class with the missing /// calcStereo2​ static function. /// /// /// /// /// /// public static int calcStereo2​(MolAtom atom1, MolAtom atom2, MolAtom atom3, MolAtom atom4) { return JavaNativeInterface.CallStaticMethod(MethodBase.GetCurrentMethod(), atom1, atom2, atom3, atom4); } /// /// Additional function. This function is not part of the original /// chemaxon.struc.MolBond class. /// /// public virtual double getLengthInAngstrom() { double length = getLength(); return length / 28 * 1.54; } } }