09-14-2015 04:45 AM
Hi,
I would like to create a .NET Dictionary object in Labview.
C# code is "Dictionary<int, List<string>> segmentBodies = new Dictionary<int, List<string>>();"
I'm able to create a List<string> as done here, but cannot create a Dictionary.
I'm aware that Labview doesn't support generics, but if possible I would like to create it in the same way as the List can be created.
Thanks for the help.
Solved! Go to Solution.
09-14-2015 02:36 PM
It might be possible - you have to know the CLR-generated type names for List<string> and Dictionary<int, List<string>>.
An idea - create a quick C# console application, create a new instance of your Dictionary and then print the actual Type name to the Console. This shiould give you a head start as to the generated name. Or you could guess it based on this (https://msdn.microsoft.com/en-us/library/w3f99sx1(v=vs.110).aspx)
If this doesn't work then my advice is to create a basic C# wrapper assembly around the Dictionary. This is probably the most maintainable option as you can limit your exposure.
09-15-2015 11:57 PM
After checking all options I decided to go with the C# wrapper. I think that at the end it's the best and easiest option.