On Thu, 05 Jun 2008 13:08:10 -0700, parez <ps*****@gmail.comwrote:
how do i put an abstract property ( or something that lets me know
that derived class has not implemented that particular property ) in
base form in my win forms project?
if i make the base form abstract then i cannot use the designer?
Well, you can't use the designer with the base class, that's right. It
might prevent using the designer from a derived class too, but you should
check that before worrying about it. I recall some specific rules about
how sub-classed sub-classes of the Form class work with the Designer, but
don't remember the specifics. :)
Have you run into some specific problem using the Designer with a
sub-class of an abstract class?
I could use "throw new NotImplementedException();" in the base form
property. then i will find out at runtime rather than compile time.
Yes, you could, for a virtual (not abstract) property. Of course, that
would rely on some code actually _using_ the property for you to find out
it hadn't been implemented. A less-risky alternative, though perhaps a
bit more "hacky", would be to include some code in the constructor of the
base class that uses reflection to look for a sub-class implementation of
the property in question.
Pete