GeorgeR
Topic Author
Posts: 39
Joined: 15 Mar 2018, 01:06

Setting default typeconverter?

10 Apr 2018, 10:12

Is it possible to set a default TypeConverter for a property or object like you can in C# (so I don't have to specify a converter every time i bind)?
 
User avatar
sfernandez
Site Admin
Posts: 1912
Joined: 22 Dec 2011, 19:20

Re: Setting default typeconverter?

10 Apr 2018, 23:47

Yes, it can be specified in the reflection block:
NS_IMPLEMENT_REFLECTION(SomeType)
{
    //...
    NsProp("SomeProperty", &SomeType::GetSomeProperty, &SomeType::SetSomeProperty)
        .Meta<TypeConverterMetaData>("SomeConverter");
    //...
}
Where "SomeConverter" is the TypeId used to register the Converter in Noesis.

Who is online

Users browsing this forum: No registered users and 3 guests