P
phancey
if I have a Generic class i.e.
ObjectManager<T> where T : myBaseObject
and a derived class i.e
CustomerManager : ObjectManager<Customer>
How can I then write a generic class like:
MyUIPage<T> where T : ObjectManager
so that I can then create classes like
MyCustomerPage<CustomerManager>?
I can't do the MyUIPage<T> base class like that because ObjectManager
has to have types too but I don't want to be caring about those types
when deriving MyCustomerPage. I just want to specify CustomerManager.
Then when I call methods of my manager it will return the relevant
type.
It seems however that I have to do MyUIPage<T,E> where
T:ObjectManager<E> and then MyCustomerPage<CustomerManager,Customer>
which seems pointless. If I have specified CustomerManager why do I
need to specify Customer again - that is already in the definition of
CustomerManager.
Any help appreciated
thanks
Phil
ObjectManager<T> where T : myBaseObject
and a derived class i.e
CustomerManager : ObjectManager<Customer>
How can I then write a generic class like:
MyUIPage<T> where T : ObjectManager
so that I can then create classes like
MyCustomerPage<CustomerManager>?
I can't do the MyUIPage<T> base class like that because ObjectManager
has to have types too but I don't want to be caring about those types
when deriving MyCustomerPage. I just want to specify CustomerManager.
Then when I call methods of my manager it will return the relevant
type.
It seems however that I have to do MyUIPage<T,E> where
T:ObjectManager<E> and then MyCustomerPage<CustomerManager,Customer>
which seems pointless. If I have specified CustomerManager why do I
need to specify Customer again - that is already in the definition of
CustomerManager.
Any help appreciated
thanks
Phil