api-doc-tools
api-doc-tools copied to clipboard
protected members from sealed classes should not be generated
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.
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
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
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 ?
Yes, that's correct, @joelmartinez.
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.