취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

How to create .net Dictionary

해결 완료!
솔루션으로 이동

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.

0 포인트
1/3 메시지
4,429 조회수

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.

0 포인트
2/3 메시지
4,396 조회수
솔루션
주제 작성자 andrej이(가) 승인함

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.

3/3 메시지
4,366 조회수