質問

I want to create a control MessageProvider just like ErrorProvider..what I did is, created a class and inherited from ErrorProvider..

But now problem is, instead of SetError and GetError methods, I want to have SetMessage and GetMessage..and those SetError and GetError methods should not be part of MessageProvider class..

How can I create a new control MessageProvider?

役に立ちましたか?

解決

You could encapsulate the ErrorProvider within your new control.

他のヒント

You cannot hide public methods from an inherited class as there is no private inheritance in the CTS. You can, however, easily add the SetMessage() and GetMessage() methods to your derived class and implement the desired functionality.

Your other option is to roll your own MessageProvider class that implements (mimics) only the desired functionality of ErrorProvider. This is probably more trouble than it's worth. I'd just derive and live with all the inherited functionality.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top