Tp.Integration.Ide.VisualStudio.Connect.CreateCommand C# (CSharp) Method

CreateCommand() private method

Adds named command to the TargetProcess popup menu.
private CreateCommand ( CommandBar commandBar, string name, string text, string tooltip ) : void
commandBar System.Windows.Forms.CommandBar Add command to this command bar.
name string Command name.
text string Command text.
tooltip string Command description.
return void
		private void CreateCommand(CommandBar commandBar, string name, string text, string tooltip)
		{
			var commands = (Commands2)_application.Commands;
			Command command;
			try
			{
				var contextGUIDS = new object[] { };
				command = commands.AddNamedCommand2(
					_addIn, name, text, tooltip, true, null, ref contextGUIDS,
					(int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled,
					(int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);
			}
			catch (ArgumentException)
			{
				command = commands.Item(_addIn.ProgID + "." + name, 0);
			}
			if (command != null)
			{
				command.AddControl(commandBar, commandBar.Controls.Count + 1);
			}
		}