Input List: ValueConverter support for Tuple<> types#514
Input List: ValueConverter support for Tuple<> types#514leekelleher wants to merge 2 commits intocontribfrom
Tuple<> types#514Conversation
|
It works - sort of... but ModelsBuilder doesn't play nice with nested generic types. I have a PR coming up :) |
|
@skttl Good catch! So far I'd been testing this out without ModelsBuilder, e.g. just using regular I've now tried out ModelsBuilder and it's exactly as you describe, with the nested Tuple closing Hmmm... so the current state of this PR would break people's ModelsBuilder setup... I'll have a think about how to proceed. 🤔 |
|
Yeah, the only way I can see is to either raise the minimum dependency (once the fix gets merged), or do some weird hacky detection of the ModelsBuilder version to make the value Or ship a companion package with a current-ModelsBuilder safe valueconverter (also making the value |
|
@skttl ...or I add a proxy class that un-nests the public class InputListTuples<T1> : List<Tuple<T1>> { }
public class InputListTuples<T1, T2> : List<Tuple<T1, T2>> { }
public class InputListTuples<T1, T2, T3> : List<Tuple<T1, T2, T3>> { }
public class InputListTuples<T1, T2, T3, T4> : List<Tuple<T1, T2, T3, T4>> { }
public class InputListTuples<T1, T2, T3, T4, T5> : List<Tuple<T1, T2, T3, T4, T5>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6> : List<Tuple<T1, T2, T3, T4, T5, T6>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6, T7> : List<Tuple<T1, T2, T3, T4, T5, T6, T7>> { }
public class InputListTuples<T1, T2, T3, T4, T5, T6, T7, TRest> : List<Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>> where TRest : notnull { }Although, this does tie the Input List property-editor to this particular object-type. 🤷 |
|
A proxy class might be the simplest option. |
|
Quick update. I've realised that I made a mistake with the Input List's value data structure in my initial feature PR #513. In the current implementation there is a tight limitation that you can only add a data-type to the tuple once, otherwise it would lead to data loss. 🤦 I have a plan to resolve this, but will take time. I am going to postpone Input List until v6.2 so to not delay v6.1. |
Description
Following @skttl's feedback for Input List to have support for
Tupleobjects, I have explored the possibility and prepared this pull request.Related Issues?
Types of changes
Checklist