Could someone provide an example or suggest tutorial whereby i can use
reflection to create an object instance whose class implements certain
interface.
Here is what I have
namespace MyFoo{
internal interface IFoo{
void Run(string [] args);
}
public class Bar:Foo{
public Run(string []args ){}
}
class Test {
static void Main(string[] args)
{
stirng className="Bar" ;
//I want to create an instance of the class and call method Run
}
}
Thanks
reflection to create an object instance whose class implements certain
interface.
Here is what I have
namespace MyFoo{
internal interface IFoo{
void Run(string [] args);
}
public class Bar:Foo{
public Run(string []args ){}
}
class Test {
static void Main(string[] args)
{
stirng className="Bar" ;
//I want to create an instance of the class and call method Run
}
}
Thanks
Comment