[mono-android] PropertyInfo on a public property coming back as read only?

Josh Handel Josh.Handel at catapultsystems.com
Wed Nov 30 22:04:18 EST 2011


So anyone have any idea why this object

public class UserCode
    {
        public int UserCodeId { get; set; }
        public int UserId { get; set; }
        public int EventId { get; set; }
        public string Code { get; set; }
    }

Would return false to PropertyInfo.CanWrite in Mono for Android when using reflections like this?

                     var objType = userCode.GetType();
                     var props = objType.GetProperties();

                     foreach (var prop in props)
                     {
                           var type = prop.PropertyType;

                           if (!type.IsPublic || !prop.CanWrite) //< --- returns false here even though the def is clearly public write.

Especially when the same lines of code work correctly on WP7 and MonoTouch?

Thanks!
Josh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111201/4376670e/attachment.html 


More information about the Monodroid mailing list