SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Menus>
  2.   <Menu guid="guidCmdSet" id="packageMenu" priority="0x0300" type="Menu">
  3.     <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_BUILD" />
  4.     <CommandFlag>DynamicVisibility</CommandFlag>
  5.     <CommandFlag>DefaultInvisible</CommandFlag>
  6.     <Strings>
  7.       <ButtonText>CPSProject</ButtonText>
  8.       <CommandName>CPSProject</CommandName>
  9.     </Strings>
  10.   </Menu>
  11.      
  12. <Groups>  
  13.   <Group guid="guidCmdSet" id="packageMenuGroup" priority="0x0600">
  14.     <Parent guid="guidCmdSet" id="packageMenu" />
  15.   </Group>    
  16. </Groups>
  17.      
  18. <Button guid="guidCmdSet" id="specialBuildActionId" priority="0x0100" type="Button">
  19.     <Parent guid="guidCmdSet" id="packageMenuGroup" />
  20.     <CommandFlag>DynamicVisibility</CommandFlag>
  21.     <Strings>
  22.       <ButtonText>Special build</ButtonText>
  23.     </Strings>
  24.      
  25. protected override async System.Threading.Tasks.Task InitializeAsync(System.Threading.CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
  26. {
  27.     // Initialize the Fluent Migrator Menu, should only be visible for projects with FluentMigrator reference
  28.     var mcs = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;
  29.     var menuCommandId = new CommandID(packageCmdSetGuidString, 0x1010);
  30.     var menuItem = new OleMenuCommand(null, menuCommandId);
  31.     menuItem.BeforeQueryStatus += MenuItem_BeforeQueryStatus;
  32.  
  33.     mcs.AddCommand(menuItem);
  34. }
  35.  
  36. private void MenuItem_BeforeQueryStatus(object sender, EventArgs e) =>
  37.     ((OleMenuCommand)sender).Visible = ???;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top