Implementation of interface when using child class of a parent class in method of interface
- by dotnetdev
I don't have access to my dev environment, but when I write the below:
interface IExample
void Test (HtmlControl ctrl);
class Example : IExample
{
public void Test (HtmlTextArea area) { }
I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework).
Thanks