TypeBuilder

2 posts, 0 answers
  1. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 26 Jan Link to this post

    When I use TypeBuilder to create public properties like:

     

    PropertyBuilder property =
       typeBuilder.DefineProperty(propertyName,
                         PropertyAttributes.None,
                         pType,
                         null);

    These are not recognized by PivotGrid, eventhough I make them public:

    MethodAttributes GetSetAttr =
         MethodAttributes.Public |
         MethodAttributes.HideBySig;
     
    // Define the "get" accessor method for current private field.
    MethodBuilder currGetPropMthdBldr =
        typeBuilder.DefineMethod("get_value",
                                   GetSetAttr,
                                   pType,
                                   Type.EmptyTypes);

    For example mouse over in Visual Studio does show them as public properties, so I would expect the PivotGrid to see them as well?

    Is there a way to make PivotGrid see those dynamic properties?

    Regards,

    Bayram

  2. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 27 Jan in reply to B Link to this post

    Ok I fixed it by letting the dynamic base class implement ICustomTypeProvider and then returning this.GetType()

     

  3. DevCraft banner
Back to Top