V
Vladimir Semenov
Hi all,
I have a problem with PropertyInfo.SetValue().
Task:
There is a generic code updating object properties using reflection. I don't
want to change this code.
One of property is of a custom type which is fully controlled by me.
Problem:
When the generic code tries to pass integer type to SetValue an exception is
thrown.
Question:
What should I do with custom type to ensure that SetValue automatically
converts integer to my custom type?
1) Declare constructor,
2) Declare TypeConverter
3) Implement conversion operator
4) ????
Thanks advance,
Vladimir
I have a problem with PropertyInfo.SetValue().
Task:
There is a generic code updating object properties using reflection. I don't
want to change this code.
One of property is of a custom type which is fully controlled by me.
Problem:
When the generic code tries to pass integer type to SetValue an exception is
thrown.
Question:
What should I do with custom type to ensure that SetValue automatically
converts integer to my custom type?
1) Declare constructor,
2) Declare TypeConverter
3) Implement conversion operator
4) ????
Thanks advance,
Vladimir