public static EasyProperty AddProperty(this CodeTypeDeclaration typeDecl, CodeMemberField field, string name)
        {
            EasyProperty p = AddProperty(typeDecl, field.Type, name);

            p.Getter.Return(new CodeVariableReferenceExpression(field.Name));
            p.Attributes |= field.Attributes & MemberAttributes.Static;             // copy static flag
            return(p);
        }
        public static EasyProperty AddProperty(this CodeTypeDeclaration typeDecl, CodeTypeReference type, string name)
        {
            EasyProperty p = new EasyProperty(type, name);

            typeDecl.Members.Add(p);
            if (typeDecl.IsInterface == false)
            {
                p.Attributes = MemberAttributes.Public | MemberAttributes.Final;
            }
            return(p);
        }
Exemple #3
0
 public EasyProperty AddProperty(CodeTypeReference type, string name)
 {
     EasyProperty p = new EasyProperty(type, name);
     this.Members.Add(p);
     if (this.IsInterface == false) {
         p.Attributes = MemberAttributes.Public | MemberAttributes.Final;
     }
     return p;
 }