dotnet / dotnet/dotnet-api-docs

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

Aperta
#7,653 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area-System.ComponentModel Pri3
Lingua principale
C#
Stelle
949
Fork
1.7k
Merge medio
2g 19h
PR unite (30g)
52

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con xml/System.ComponentModel.Design/MenuCommand.xml e rivedi la documentazione esistente per MenuCommand.Supported. Verifica cosa comportano true e false nel Visual Studio Extensibility SDK, incluso il valore predefinito e il comportamento visibile all’utente, quindi aggiungi una sezione Remarks che documenti questi risultati e spieghi il comportamento segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.