dotnet / dotnet/dotnet-api-docs

Regarding the `MenuCommand.Supported` property in the Visual Studio Extensibility SDK

Offen
#7,653 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area-System.ComponentModel Pri3
Vorherrschende Sprache
C#
Sterne
950
Forks
1.7k
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
52

Beschreibung

My issue is with `xml/System.ComponentModel.Design/MenuCommand.xml`, located at `https://github.com/dotnet/dotnet-api-docs/blob/f5ba02279848e492aa825869ca1fb8d3ad46a5ae/xml/System.ComponentModel.Design/MenuCommand.xml`.

The page referenced is the documentation for the `MenuCommand.Supported` property in the Visual Studio Extensibility toolkit.

When I set `MenuCommand.Supported` to `false`, it is not obvious what doing that means.

Nothing changed in the user experience by setting the `Supported` property to `false`; that I can see anyway, as a result. That does not mesh with my expectation.

This page is not helpful to me either, as it does not say what happens in Visual Studio's interface, or anywhere else in the user experience if the `Supported` property is set to `false`.

This documentation, as written, merely states:

* a) the property exists;
* b) it's a `Boolean`, and
* c) provides sample code setting the property to `true`.

But there is no discussion as to what the values `true` and `false` for the `Supported` property actually do, or what the default is.

All of these, I surmise, are essential pieces of information to know as a developer.

My use case is the following:

I am working on an extension that I have forked from someone else, and the author has set `Supported` to `false` for a particular `MenuCommand` they are adding.

Apparently, from my own experience, setting `Supported` to `false` does nothing.

The expected behavior from setting `Supported` to `false` is for the menu command to:

* a) Not be visible on Visual Studio menus and toolbars (according to where my `.vsct` has placed it); or,
* b) Showing the command, but graying it out.

Yet the command still appears in the VS menus, is selectable, and, when I, as a user, select the command, the specified handler is executed.

So what does setting `Supported` to `false` really even do?

If it does something, I'd like to know.

If it does not (perhaps it's deprecated), then I'd also like to know.

Therefore, I'd like to respectfully suggest augmenting the documentation on this property with a `Remarks` section that goes into more detail about the outcomes of setting the `MenuCommand.Supported` property to `true` versus `false`.

Thank you in advance for your consideration.

Regards,

Brian Hart

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit xml/System.ComponentModel.Design/MenuCommand.xml und überprüfen Sie die vorhandene Dokumentation für MenuCommand.Supported. Überprüfen Sie, welche Auswirkungen true und false im Visual Studio Extensibility SDK haben, einschließlich des Standardwerts und des für Benutzer sichtbaren Verhaltens, und fügen Sie anschließend einen Abschnitt Remarks hinzu, der diese Ergebnisse dokumentiert und das gemeldete Verhalten erklärt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.