public static bool CanWriteInto(PropertyInfo propertyInfo)
{
if (!propertyInfo.CanWrite)
{
return false;
}
// if the property is located in this class then we don't write into it.
if (typeof(AppSettings) == propertyInfo.DeclaringType)
{
return false;
}
// If the property is ignored then we don't write into it.
var ignoredAttribute = propertyInfo.GetCustomAttribute<IgnorePropertyAttribute>();
if (null != ignoredAttribute)
{
return ignoredAttribute.EnableWriting;
}
return true;
}