Category: visual studio extensibility
Priyadarshini Gorur on Thu, 04 Jul 2019 08:35:08
When I run the sample at https://github.com/microsoft/VSSDK-Extensibility-Samples/tree/master/ArchivedSamples/Source_Control_Provider_Status_Bar_Integration, I do not see an icon next to the sample source control provider when I click Publish/Add to Source Control button on the status bar. I see one against the Git integration though.
Is there any property I can set on the ProvideSourceControlProviderAttribute or in the IVsSccPublish interface or any other way I can show an icon against the source control provider listed in the Publish/Add to Source Control menu on status bar?
Charles He21 on Mon, 15 Jul 2019 11:16:59
Thanks for posting here. We will investigate this question and you can also open an issue at the repo microsoft/VSSDK-Extensibility-Samples.
Ed Dore on Mon, 15 Jul 2019 22:31:27
Unfortunately there isn't a way to add icons to the menu items for the 3rd party providers displayed in this particular menu. The GIT and TFS menu commands which are listed in the top menu group (above that menu divider) are actually implemented as individual menu commands defined in an internal VSCT menu resource. So they can actually have an icon associated with them. For example:
However, the item(s) listed below that group divider (Like that Managed Source Provider, or even the AnkSVN (Subversion Provider) are dynamically generated menu items, which don't have the ability to specify an icon resource.
Menus created using DynamicItemStart don't support the Icon CommandFlag. So unfortunately, there isn't a way to add an icon, to the menu item(s) you see using this particular command.
Microsoft Developer Support