3
this 질문을 참조하십시오.VSIX 방법을 실행하기위한 바로 가기를 만드는 방법은 무엇입니까?
초기 질문이 해결되어 내 연장에 방법이 있습니다. 사용자가 내선 번호를 설치할 때 키보드 바로 가기도 설치해야하며 키를 누를 때 메소드를 실행해야합니다.
어떻게하면됩니까?
this 질문을 참조하십시오.VSIX 방법을 실행하기위한 바로 가기를 만드는 방법은 무엇입니까?
초기 질문이 해결되어 내 연장에 방법이 있습니다. 사용자가 내선 번호를 설치할 때 키보드 바로 가기도 설치해야하며 키를 누를 때 메소드를 실행해야합니다.
어떻게하면됩니까?
.vsct 파일에 바로 가기를 추가 할 수 있습니다. 이 파일은 새 확장을 생성하고 메뉴 명령이 있다고 말할 때 마법사에서 자동으로 만들어집니다. 수동으로 추가하려면 다음
:
<VSCTCompile Include="MyCommands.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<SubType>Designer</SubType>
</VSCTCompile>
: 당신의 Package.Initialize에서
<KeyBindings>
<KeyBinding guid="yourCmdSet" id="cmdAwesome"
editor="guidVSStd97"
key1="VK_F7" mod1="Control Alt"
key2="VK_F1">
</KeyBinding>
</KeyBindings>
:
[ProvideMenuResource("Menus.ctmenu",1)]
public sealed class MyPackage : Package
:
// Add our command handlers for menu/shortcut (commands must exist in the .vsct file)
OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
if (null != mcs)
{
//// Create the command for the menu item.
var menuCommandID = new CommandID(GuidList.yourCmdSet,(int)PkgCmdIDList.cmdAwesome);
var menuItem = new MenuCommand((sender, evt) =>
{
// Do stuff
}
}
추가 자료 :
이 또한 확인은''섹션은''바로 다음에 있습니다. 파일에 무작위로 추가하고 xml 스키마 오류가 있습니다. –
KernelMode