Ok, that explains at least what you want to do: You can use
Activator.CreateInstance("name-of-your-assembly", "layout1").Unwrap(), to
create an instance of a class by its name.
However, the more "type-safe" approach would be something like:
Type myClass = typeof(layout1);
....
Table myTable = Activator.CreateInstance(myClass);
Or you could implement IClonable in all your classes, and write:
ICloneable myClass = new layout1;
....
Table myTable = myClass.Clone();
(I think this one is GoF pattern, but don't remember it's name)
Niki
"Kieran" <an*******@discussions.microsoft.com> wrote in
news:67**********************************@microsof t.com...
Hi,
Thanks for your reply, I was hoping though to feed in the class name
though, e.g
string myClass = 'layout1'
Table myTable = new myClass
I know the above wont work but I hope this explains what I'm trying to do.
I'm effectively trying to decide the class to use at runtime?.
Thanks
Kieran