api-doc-tools icon indicating copy to clipboard operation
api-doc-tools copied to clipboard

protected members from sealed classes should not be generated

Open TianqiZhang opened this issue 8 years ago • 5 comments

If a class is sealed, then you can't inherit it, so its protected members are invisible to users. So we should also hide those members in documentation.

TianqiZhang avatar Jun 20 '17 07:06 TianqiZhang

This is an example of this issue:

Compare https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.instancecontext with https://msdn.microsoft.com/en-us/library/system.servicemodel.instancecontext

It shows protected members and inherited protected members for this class. They shouldn't show up.

/cc @rpetrusha @dend @joelmartinez

mairaw avatar Jul 12 '18 21:07 mairaw

There's another interesting case where docs shows the behavior we want for the InternalDispose method but the source file is expecting that member to be documented (even though it's not shown anywhere): https://docs.microsoft.com/en-us/dotnet/api/system.printing.indexedproperties.printint32property https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Printing.IndexedProperties/PrintInt32Property.xml#L94

mairaw avatar Dec 15 '18 01:12 mairaw

So to be clear, what we want here is for protected members to be excluded from the repo files, when the class that contains it is sealed ?

joelmartinez avatar Dec 17 '18 14:12 joelmartinez

Yes, that's correct, @joelmartinez.

rpetrusha avatar Dec 18 '18 01:12 rpetrusha

We also have this protected member showing up for this class which is not sealed: https://docs.microsoft.com/en-us/dotnet/api/system.transactions.configuration.defaultsettingssection.properties?view=netframework-4.7.2#System_Transactions_Configuration_DefaultSettingsSection_Properties

But we didn't document this one for MSDN and https://apisof.net/catalog/System.Transactions.Configuration.DefaultSettingsSection also doesn't show that as a member.

I imagine it's because it's overriding a member which is protected internal: https://apisof.net/catalog/System.Configuration.ConfigurationElement.Properties

Perhaps @terrajobst can help with the logic on this one.

mairaw avatar Dec 19 '18 00:12 mairaw