G
Guest
I want to be able to register a class that a factory can build for me at a
later time.
How can I pass the class's type to a method?
public class MyClass{
static public void Register(Type type)
{
// do something with: type
}
}
....
MyClass.Register(System.Windows.Forms.Form);
....
I would get the error: "X" is a 'type' but is used like a 'variable'.
later time.
How can I pass the class's type to a method?
public class MyClass{
static public void Register(Type type)
{
// do something with: type
}
}
....
MyClass.Register(System.Windows.Forms.Form);
....
I would get the error: "X" is a 'type' but is used like a 'variable'.