Guys,
I've got an issue but I also dont know if its possible. I've templated (generic'd out a class that takes type T where T is a HtmlControl object
...
internal class Controller<T> where T : HtmlControl
{
public T locateControl(T t)
{
t.SearchProperties.Clear();
t.Find();
return t;
}
}
this gets called like...
FindControl<HtmlEdit> controllocator = new FindControl<HtmlEdit>();
HtmlEdit txtEntityName = controllocator.findControl(new HtmlEdit());
... do stuff here
Now what I'm finding is that if I have a new control thats a subclass of HtmlControl I'm having to redefine the FindControl class again with the new type of control. I don't really want to have to do this... Is there a nicer way of tackling it?
For example
FindControl<HtmlEdit> controllocator = new FindControl<HtmlEdit>();
HtmlEdit txtEntityName = controllocator.findControl(new HtmlEdit());
FindControl<HtmlLongEdit> controllocator2 = new FindControl<HtmlLongEdit>();
HtmlEdit txtEntityName = controllocator2.findControl(new HtmlLongEdit());
Why can't I have something like this
FindControl<HtmlEdit> controllocator = new FindControl<HtmlEdit>();
HtmlEdit txtEntityName = controllocator.findControl(new HtmlEdit());
HtmlLongEdit txtEntityName = controllocator2.findControl(new HtmlLongEdit());