Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, that's correct. The two methods have very different purposes.</p> <ul> <li><p>The <code>/// &lt;summary&gt;&lt;/summary&gt;</code> comments are used to generate XML documentation for your project at compile-time, which is also parsed by Visual Studio for its IntelliSense database.</p></li> <li><p>The <code>[DescriptionAttribute]</code> provides description text that is used in the designer, most notably at the bottom of the Properties Window.</p></li> </ul> <p>Microsoft's own Windows Forms library is littered with both these. </p> <p>I don't know of any way to merge the two, but consider whether you really want them to be <em>exactly</em> the same. In my own class libraries, I often want to display slightly different information in the designer than I want to include in my technical documentation.</p> <p>As a simple example, I might want to make clear in the designer that this property is not supported under certain versions of Windows, but relegate this information to the <code>&lt;remarks&gt;</code> section in my tech docs:</p> <pre><code>/// &lt;summary&gt; /// Gets or sets a value indicating whether a shield should be displayed /// on this control to indicate that process elevation is required. /// &lt;/summary&gt; /// &lt;remarks&gt; /// The elevation-required shield is only supported under Windows Vista /// and later. The value of this property will be ignored under earlier /// operating systems. /// &lt;/remarks&gt; [Category("Appearance")] [Description("Displays a shield to indicate that elevation is required. " + "(Only applies under Windows Vista and later.)")] public bool ShowShield { get; set; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload