M
MrEd
Hi all, I need to pass a class to a method, (not an instance of a
class), I'll explain...
lets say we have a class, lets call it Shape (as the tipical example),
then lets say that i also have Circle, Rectangle and Triangle classes
that inherit from Shape.
what I need is to create a method on a helper class like this:
static public Shape[] DoSomething(<type of shape> classType, ...some
other params)
{
// do some loop according to other parameters
// create instances if what ever the classType is
classType newInstance = new classType();
//add them to the result array
class), I'll explain...
lets say we have a class, lets call it Shape (as the tipical example),
then lets say that i also have Circle, Rectangle and Triangle classes
that inherit from Shape.
what I need is to create a method on a helper class like this:
static public Shape[] DoSomething(<type of shape> classType, ...some
other params)
{
// do some loop according to other parameters
// create instances if what ever the classType is
classType newInstance = new classType();
//add them to the result array