public FieldDeclaration AddField(string name)
        {
            FieldDeclaration fd = new FieldDeclaration(
                Conformer.ToCapitalized(name),
                this,
                new TypeTypeDeclaration(typeof(int))
                );

            fd.Attributes = MemberAttributes.Public;
            this.fields.Add(fd);
            return(fd);
        }
        public PropertyDeclaration AddProperty(
            FieldDeclaration f,
            bool hasGet,
            bool hasSet,
            bool checkNonNull
            )
        {
            var p = AddProperty(
                f.Type,
                Conformer.ToCapitalized(f.Name));

            if (hasGet)
            {
                p.Get.Return(Expr.This.Field(f));
            }
            if (hasSet)
            {
                if (checkNonNull)
                {
                    var ifnull = Stm.If(Expr.Value.Identity(Expr.Null));
                    p.Set.Add(ifnull);
                    ifnull.TrueStatements.Add(
                        Stm.Throw(typeof(ArgumentNullException))
                        );
                    p.SetExceptions.Add(new ThrowedExceptionDeclaration(
                                            typeof(ArgumentNullException),
                                            "value is a null reference"
                                            ));
                }
                p.Set.Add(
                    Stm.Assign(
                        Expr.This.Field(f),
                        Expr.Value
                        )
                    );
            }

            return(p);
        }
Example #3
0
 public static void WedgeMolBonds(ROMol mol, Conformer conf)
 {
     mol.WedgeMolBonds(conf);
 }
Example #4
0
 public static void SetDoubleBondNeighborDirections(ROMol mol, Conformer conf = null)
 {
     RDKFuncs.setDoubleBondNeighborDirections(mol, conf);
 }