Visual Studio - Tag Summary Comments - Advanced Options

When specifying comments of the resulting tags, their path with the <param> is that the parameter is optional, i.e. the client can specify a value or null, for example: <param name="Mime" optional="true">.

Googling did not provide me with a list of attributes or valid values.

 /// <summary> /// Sets data associated with instance /// </summary> /// <param name="Key">The key defining the data</param> /// <param name="Value">The data</param> /// <param name="Mime">The mime type of the data (optional)</param> <----- Mark as optional 

thanks

+7
source share
3 answers

No, you can’t. The only tag recognized by VS is name , for example:

 <param name="FileName" >The filename of the file to be loaded.</param> 

The only thing you can do is install xsl transform for your output. But this will not affect Intellisense.

+5
source

You can use the <remarks></remarks> . There is no special tag for optional parameters.

+1
source

You must specify an overload that omits the optional parameter:

 /// <summary> /// Sets data associated with the instance using the default media type. /// </summary> /// <param name="key">The key defining the data.</param> /// <param name="value">The data.</param> public void SetData(object key, object value) { SetData(key, value, null); } /// <summary> /// Sets data associated with the instance using the specified media type. /// </summary> /// <param name="key">The key defining the data.</param> /// <param name="value">The data.</param> /// <param name="mime">The media type of the data.</param> public void SetData(object key, object value, string mime) { ... } 

Alternatively, you can declare the parameter as optional:

 /// <summary> /// Sets data associated with the instance. /// </summary> /// <param name="key">The key defining the data.</param> /// <param name="value">The data.</param> /// <param name="mime">The media type of the data.</param> public void SetData(object key, object value, string mime = null) { ... } 
+1
source

All Articles