Skip to content

Common parts extracted + more changes for #984 - #987

Open
n9 wants to merge 1 commit into
aaubry:masterfrom
n9:patch1
Open

Common parts extracted + more changes for #984#987
n9 wants to merge 1 commit into
aaubry:masterfrom
n9:patch1

Conversation

@n9

@n9 n9 commented Sep 27, 2024

Copy link
Copy Markdown

Common parts from ReadablePropertiesTypeInspector and WritablePropertiesTypeInspector are extracted to PropertiesTypeInspector and more changes to support #984:

  • virtual method PropertiesTypeInspector.CreateProperty
  • public property ReflectionPropertyDescriptor.PropertyInfo

…and WritablePropertiesTypeInspector

+ add virtual method CreateProperty to PropertiesTypeInspector and PropertyInfo to ReflectionPropertyDescriptor for aaubry#984
@n9

n9 commented Sep 27, 2024

Copy link
Copy Markdown
Author

PS: During the refactoring I found that the type inspectors might need more refactoring:

The ReadableAndWritablePropertiesTypeInspector only checks if properties are writable, but despite its name it does not check if they are readable.

public override IEnumerable<IPropertyDescriptor> GetProperties(Type type, object? container)
{
return innerTypeDescriptor.GetProperties(type, container)
.Where(p => p.CanWrite);
}

Maybe it should be renamed to something like WritablePropertiesTypeInspectorFilter? (But that would be a breaking change.)

Do you want to create an issue for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant