Home All Groups Group Topic Archive Search About

Adding contraints and inheriting

Author
21 Sep 2006 8:04 AM
Paul
Hi All

A simple question I hope

I have a class

public abstract class authenticatedBoundForm<T> : authenticatedPage,
IControlPage

I want to add contraints to T specifially the new() contraint.

How can I do this without T being forced to inherit/implement
authenticatedPage, IControlPage

Thanks
Paul

Author
21 Sep 2006 8:24 AM
Joanna Carter [TeamB]
"Paul" <paul.tho***@corpoflondon.gov.uk> a écrit dans le message de news:
1158825894.588557.319***@i42g2000cwa.googlegroups.com...

| public abstract class authenticatedBoundForm<T> : authenticatedPage,
| IControlPage
|
| I want to add contraints to T specifially the new() contraint.
|
| How can I do this without T being forced to inherit/implement
| authenticatedPage, IControlPage

public abstract class authenticatedBoundForm<T> : authenticatedPage,
IControlPage where T : new()

T is not affected by the inheritance, only by the constraints.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Author
21 Sep 2006 8:26 AM
Paul
:)

Thanks Joanna

AddThis Social Bookmark Button