public void AddItem()
{
this.Add(new ***); // here is where I'm stumped
}
private void Add(MySubItemType inSubItem)
{
this.Controls.Add(inSubItem);
}
There needs to be a type where the *** is but this type will not be known until runtime. Obviously, it will derive from MySubItem. Is there any way to do this other than passing in an instance of the unknown item type at runtime and somehow parsing the layout, then modifying the MySubItem on the fly? Something to the effect of:
this.Add(new typeof(SpecialSubItemType));
where SpecialSubItemType derives from MySubItemType
I know this doesn't work, but maybe it will help explain what I'm trying to do.
{
this.Add(new ***); // here is where I'm stumped
}
private void Add(MySubItemType inSubItem)
{
this.Controls.Add(inSubItem);
}
There needs to be a type where the *** is but this type will not be known until runtime. Obviously, it will derive from MySubItem. Is there any way to do this other than passing in an instance of the unknown item type at runtime and somehow parsing the layout, then modifying the MySubItem on the fly? Something to the effect of:
this.Add(new typeof(SpecialSubItemType));
where SpecialSubItemType derives from MySubItemType
I know this doesn't work, but maybe it will help explain what I'm trying to do.