B
Brett Romero
I'd like to design a class that is runtime typed (generic) and the
types will always have a specific member. For example:
public T MyClass
{
T temp = default(T);
Void Fill
{
T.PopulateMe();
}
}
What ever type I send in always has a method named PopulateMe(). I
imagine the types going into the class will need to implement an
interface with the one member. How do I then tell the generic class
(MyClass) that the member is always available since the parameter is
only T?
Thanks,
Brett
types will always have a specific member. For example:
public T MyClass
{
T temp = default(T);
Void Fill
{
T.PopulateMe();
}
}
What ever type I send in always has a method named PopulateMe(). I
imagine the types going into the class will need to implement an
interface with the one member. How do I then tell the generic class
(MyClass) that the member is always available since the parameter is
only T?
Thanks,
Brett