简体   繁体   中英

Hide some inherited methods from intellisense

I've created a UserControl. Let's imagine that code:

public class MyUserControl : UserControl
{
  Button button1;
  Button button2;

  //...
}

With that UserControl i can click on one of the buttons and this fires some events ( Button1Clicked , Button2Clicked ).

Now with the UserControl there are some other events, but i never use that events like MouseMove or Dragging ( DragEnter , DragLeave , DragOver , ...). Intellisense shows a huge list of events that are useless in my UserControl.

Is there a common way to hide those inherited events? My main reason is intellisense but also documentation (XML-summaries).

As the comments reveal: No, there is no way to hide inherited events from Intellisense.

It is probably a bad decision too. If there would be a way, what if you forgot to unhide it when you implement it? Nobody would see that method but it would be there and if you type it, it would work. That would be a little bit odd.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM