Плагин для MVS. Добавление пункта в контекстное меню
пишу плагин для MVS, необходимо создать пункт в контекстном меню редактора кода. вроде все правильно, но пункт не рисуется. подскажите пожалуйста в чем может быть дело
Код:
Command myCommand = null;
CommandBarButton myCodeWindowCommandBarButton = null;
CommandBar codeCommandBar = null;
codeCommandBar = ((CommandBars)_applicationObject.CommandBars)["Code Window"];// commandBars[VS_CODE_WINDOW_COMMANDBAR_NAME];
if (myCommand == null)
{
myCommand = _applicationObject.Commands.AddNamedCommand(_addInInstance, "Name",
"Title", "Tip", true, 59, ref contextGuids, (int)(vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled));
}
try
{
myCodeWindowCommandBarButton = (CommandBarButton)myCommand.AddControl(codeCommandBar, codeCommandBar.Controls.Count + 1);
myCodeWindowCommandBarButton.Caption = "Start";
myCodeWindowCommandBarButton.BeginGroup = true; // Separator line above button
myCodeWindowCommandBarButton.Visible = true;
}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
CommandBarButton myCodeWindowCommandBarButton = null;
CommandBar codeCommandBar = null;
codeCommandBar = ((CommandBars)_applicationObject.CommandBars)["Code Window"];// commandBars[VS_CODE_WINDOW_COMMANDBAR_NAME];
if (myCommand == null)
{
myCommand = _applicationObject.Commands.AddNamedCommand(_addInInstance, "Name",
"Title", "Tip", true, 59, ref contextGuids, (int)(vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled));
}
try
{
myCodeWindowCommandBarButton = (CommandBarButton)myCommand.AddControl(codeCommandBar, codeCommandBar.Controls.Count + 1);
myCodeWindowCommandBarButton.Caption = "Start";
myCodeWindowCommandBarButton.BeginGroup = true; // Separator line above button
myCodeWindowCommandBarButton.Visible = true;
}
catch (System.Exception e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}