I am auto-generating code that creates a winform dialog based on configuration (textboxes, dateTimePickers etc). The controls on these dialogs are populated from a saved da
I noticed that when using PropertyInfo, the CanWrite property is true even if the setter is private. This simple check worked for me:
CanWrite
bool IsReadOnly = prop.SetMethod == null || !prop.SetMethod.IsPublic;