I\'m trying to reflect over some class properties and set them programaticlly, but it looks like one of my PropertyInfo filters isn\'t working:
//Get all pub
From the documentation:
BindingFlags.SetProperty
Specifies that the value of the specified property should be set. For COM properties, specifying this binding flag is equivalent to specifying PutDispProperty and PutRefDispProperty.
BindingFlags.SetProperty
and BindingFlags.GetProperty
do not filter properties that are missing setters or getters, respectively.
To check if a property can be set, use the CanWrite
property.
if (pi.CanWrite)
pi.SetValue(this, valueFromData, null);