Question

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.

Managed Source Control Sample Provider (C#)

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?

Replies

Charles He21 on Mon, 15 Jul 2019 11:16:59


Hi Priyadarshini,

Thanks for posting here. We will investigate this question and you can also open an issue at the repo microsoft/VSSDK-Extensibility-Samples.

Thanks,

Charles

Ed Dore on Mon, 15 Jul 2019 22:31:27


Hi Priyadarshini,

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:

<Button guid="guidSccDisplayInformationCommandSet" id="cmdidGit" priority="0x0000" type="Button">
<Parent guid="guidSccDisplayInformationCommandSet" id="MicrosoftPublishGroup" />
<Icon guid="ImageCatalogGuid" id="Git"/>
<CommandFlag>IconIsMoniker</CommandFlag>
<CommandFlag>DynamicVisibility</CommandFlag>
<Strings>
<ButtonText>&amp;Git</ButtonText>
</Strings>
</Button>

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.  

<Button guid="guidSccDisplayInformationCommandSet" id="cmdidPublishStart" priority="0x0200" type="Button">
<Parent guid="guidSccDisplayInformationCommandSet" id="NonMicrosoftPublishGroup" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DynamicItemStart</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<ButtonText>Publish</ButtonText>
</Strings>
</Button>

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.

Sincerely,
Ed Dore
Microsoft Developer Support