Tony Maresca wrote:
Hi. I have a class derived from a UserControl, that I want to allow
others to derive controls from. I don't want them to design the base
class (which is derived from a UserControl).
I know that I can prevent the control from being designed by making
it not the first class in the code file, but is there another more
'official' way to do this via attributes.
The user should be able to add the control's source to a project (or
reference it in another assembly), and then select the control in the
Inheritance Picker, to create a derived class, but I want to prevent
the user from designing the base class.
I'm not quite sure I follow you. The thing is, a control can only be
designed if the source code of that control is available to the user. If
you give the user only the compiled assembly with the control in it, he
won't be able to make changes to the control.
Now, if you're giving the user the source and you assume that the user
might try to make changes to the control although you told him not to do
that, what help would an attribute be? The user could just change that
attribute or remove and design away. Not?
Oliver Sturm
--
omnibus ex nihilo ducendis sufficit unum
Spaces inserted to prevent google email destruction:
MSN oliver @ sturmnet.org Jabber sturm @ amessage.de
ICQ 27142619
http://www.sturmnet.org/blog