1

I just found out that is now included by default in visual studio. So I started writing comments for my class which makes extensive use of inheritance. What I am trying to do is inherit only parts of my decription from above. So for example when writting xml-comments for the constructor of an inherited class, I want him to inherit the description for my parameters but want to specify an more specific comment for the summary field. I tried this approch but unfortunally it doesn't worked:

    ''' <summary>
''' Creates a new belt-instance
''' </summary>
''' <param name="OpcClient"><inheritdoc/></param>
''' <param name="BaseNode"><inheritdoc/></param>
''' <param name="PropertyChangedNotificationsRequested"><inheritdoc/>/param>
Sub New(ByRef OpcClient As OpcUaClient, ByVal BaseNode As OpcNodeId, ByVal PropertyChangedNotificationsRequested As Boolean)
    MyBase.New(OpcClient, BaseNode, PropertyChangedNotificationsRequested)
    ...
End Sub

Always inheriting the the whole comment seemt to be a bit overdone, because the more you go uo the inheritance-chain, the mor general and unspecific the comments get most of the time. How to achieve that kind of partial inheritance of comments?

1 Answer 1

3

I haven't found a solution in internet, but tried a bit with different solutions. The following one seems to work

  1. Add all things you want to override.
  2. Add the afterwards.

Example:

    ''' <summary>
''' I am overriding
''' </summary>
''' <param name="BaseNode">I am also</param>
''' <inheritdoc/>
Sub New(ByRef OpcClient As OpcUaClient, ByVal BaseNode As OpcNodeId, ByVal PropertyChangedNotificationsRequested As Boolean)
    MyBase.New(OpcClient, BaseNode, PropertyChangedNotificationsRequested)
    ...
End Sub

If there is also a more clean solution or some additional information regarding this case I would like to hear about it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.