protected bool MatchReadOnlyProperty(MemberInfo subject) { var property = subject as PropertyInfo; if (property == null) { return(false); } if (CanReadCantWriteInsideType(property) || CanReadCantWriteInBaseType(property)) { return(PropertyToField.GetBackFieldInfo(property) == null); } return(false); }
protected bool MatchNoSetterProperty(MemberInfo subject) { var property = subject as PropertyInfo; if (property == null || property.CanWrite || !property.CanRead) { return(false); } var fieldInfo = PropertyToField.GetBackFieldInfo(property); if (fieldInfo != null) { return(fieldInfo.FieldType == property.PropertyType); } return(false); }
protected bool MatchPropertyToField(MemberInfo subject) { var property = subject as PropertyInfo; if (property == null) { return(false); } var fieldInfo = PropertyToField.GetBackFieldInfo(property); if (fieldInfo != null) { return(fieldInfo.FieldType != property.PropertyType); } return(false); }