Skip to content

Ability to use converters and a type factory #343

Open
@robsonfelix

Description

@robsonfelix

Giacomo, your library rocks!

I am trying to accommodate some needs we have for a project using the library and I need your help. We successfully added a way to use custom types (classes) as Options property types by changing the TypeConverter class on the MakeType function delegate by adding a try/catch with the constructor. That way we redirected the constructor to some other static factory method that was able to create the value instance.

The other thing we did was to change the ReflectionExtensions class on the SetValue method by adding a way to get the TypeDescriptor for a particular property once the original property.SetValue method failed on setting the property value.

However it looks like adding a Type Factory to the ParserSettings (instead of hardcoding such factory into the TypeConverter class) is too complicated. That would be the ideal scenario.

Is there anything you suggest we do to make this change easier?

We believe the changes we did are very good for other developers to use (we created a sort of type-variant class set that can work interchangeably with boolean, integer and other numeric types, text, etc). Hence the need to use other types (rather than struct or base .NET CLR types). As for the changes we did to your code, they can be gladly shared.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions