I have ClassLibrary (in visual studio 2010 C#) with a class Car:
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("ClassLibrary1.Car")]
public class Car
{
public Car()
{
Name = "";
Parts = new List<string>();
}
public string Name { get; set; }
public List<string> Parts { get; set; }
}
But when I use it in vb6 project: there is no property "Parts": https://i.sstatic.net/nMfEi.jpg
What can I do to make property List<> visible?
Of course, the file "AssemblyInfo.cs" contains:
[assembly: ComVisible(true)]
P.S. I really do not want to create for each List the class, like this:
public class Parts
{
private List<string> _parts;
public Parts()
{
_parts = new List<string>();
}
public void Add(string part)
{
_parts.Add(part);
}
public string GetAt(int index)
{
if (0 <= index && index < _parts.Count)
return _parts[index];
return "";
}
public void Clear()
{
_parts.Clear();
}
public int Count{ get{ return _parts.Count; } }
}
because there are too many.