开发者

Using the MSDN docs, is it possible to hide or filter inherited members?

开发者 https://www.devze.com 2023-03-04 21:35 出处:网络
One of the coolest features I\'ve seen in help viewers is the ability to hide inherited members so you can focus on only what that particular subclass offers.A good example of this is here...

One of the coolest features I've seen in help viewers is the ability to hide inherited members so you can focus on only what that particular subclass offers. A good example of this is here...

http://james.newtonking.com/projects/json/help/html/T_Newtonsoft_Json_JsonConvert.htm

Actually, that page has various options for how to show the help, not just hiding inherited members.

Now online MSDN has a habit of just throwing everything under the sun at you meaning trying to 开发者_如何学运维figure out what a subclass has added, let alone getting to it requires tons of scanning and even more scrolling.

That said, is there any way, local or online, to enable those or similar features? Has anyone made an external or third-party help viewer that does this or something similar?

(Note: I'm not really sure if this is for SO since it's not a programming thing, but it is sort of an IDE-related thing so I figured I'd gamble and put it here.)

Mark


Hiding inherited items is one thing I used to miss in the Lightweight style online MSDN docs.

Fortunately, it can be easily solved by using a litte bit of in browser javascript. See How to hide inherited members on MSDN pages for details.

You should be able to expand the used principle to hide any information you need (eg. you could use the icons to tell apart the static members, methods, properties and so on...).


Updated answer for 2016:

Create a bookmark in a modern browser with the following javascript snippet as the URL:

javascript:var trs=document.getElementsByTagName('tr');var l=trs.length;for (var i=0; i<l; i++) {  var tr=trs[i];  if (tr.innerHTML.indexOf('(Inherited from ')>-1)  tr.style.display=tr.style.display=='none'?'':'none'; }; void(0);

Clicking this bookmark while on an MSDN class documentation page will toggle all the inherited members on and off.

The javascript is just looking through all of the table rows ('tr') on the page, finding any which contain the string '(Inherited from ', and setting their display style (visibility) to 'none'. That search string seems to cover every instance of a member being inherited.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号