With LINQ (Language-Integrated Query) becoming increasing prevolant in .Net programming, more and more classes are using <T> Generics.
Unfortunately, LabVIEW does not support Generics, which limits the Methods and Classes available when importing .Net Dll's.
Take the following code:
namespace GenericsTest
{
public class GenericList<T>
{
void Add(T input) { }
}
public class NonGenericList
{
void AddNoT() { }
}
class TestGenericList
{
private class ExampleClass { }
static void Main()
{
// Declare a list of type int.
GenericList<int> list1 = new GenericList<int>();
// Declare a list of type string.
GenericList<string> list2 = new GenericList<string>();
// Declare a list of type ExampleClass.
GenericList<ExampleClass> list3 = new GenericList<ExampleClass>();
}
}
}
When importing this to LabVIEW
Notice that I can only see the "NonGenericList" Class as LabVIEW fails to destruct the "GenericList" Class.
One solution to this problem may to treat generics as Method/Constructor inputs, allowing the developed to choose the Generic Type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.