概要 https://msdn.microsoft.com/ja-jp/library/bb166441.aspx 上記のページに Visual Studio の拡張機能に関する 公式のドキュメントがまとめられています
方法 ソリューションエクスプローラーで「Resources」フォルダを右クリックして 「追加>既存の項目」を選択してアイコンの画像ファイルを追加します そして、.vsct ファイルに「GuidSymbol」を追加します <GuidSymbol name="addButtonSet" value="【GUID】"> <IDSymbol name="addButton" value="1" /> </GuidSymbol> name は適当に設定して、GUID は Visual Studio …
概要 .vsct ファイルの「Button」に <CommandFlag>DefaultDisabled</CommandFlag> を追加して コマンドがデフォルトで無効になるように設定します <Buttons> <Button guid="guidCommand1PackageCmdSet" id="Command1Id" priority="0x0100" type="Button"> <Parent guid="guidCommand1PackageCmdSet" id="MyMenuGroup" /> <Icon guid="guidImages" id="bmpPic1" /> <…</icon></parent></button></buttons>
方法 .vsct ファイルに「KeyBinding」を追加する <KeyBindings> <KeyBinding guid="guidCommand1PackageCmdSet" id="Command1Id" editor="guidVSStd97" mod1="Control" mod2="Control" key1="T" key2="S" /> </KeyBindings> 参考サイト様 https://stackoverflow.com/questions/15071825/how-to-register-key-binding-code-on-vsix-package-insta…
概要 上記のページで公式のサンプルが31種類公開されています
方法 Button に <CommandFlag>DefaultInvisible</CommandFlag> を追加する <Buttons> <Button guid="guidCommand1PackageCmdSet" id="Command1Id" priority="0x0100" type="Button"> <Parent guid="guidCommand1PackageCmdSet" id="MyMenuGroup" /> <Icon guid="guidImages" id="bmpPic1" /> <CommandFlag>DefaultInvisible</commandflag></icon></parent></button></buttons>
方法 Button に <CommandFlag>DefaultDisabled</CommandFlag> を追加する <Buttons> <Button guid="guidCommand1PackageCmdSet" id="Command1Id" priority="0x0100" type="Button"> <Parent guid="guidCommand1PackageCmdSet" id="MyMenuGroup" /> <Icon guid="guidImages" id="bmpPic1" /> <CommandFlag>DefaultDisabled</commandflag></icon></parent></button></buttons>
方法 .vsct ファイルの「Button」に <CommandFlag>TextChanges</CommandFlag> を追加する <Buttons> <Button guid="guidCommand1PackageCmdSet" id="Command1Id" priority="0x0100" type="Button"> <Parent guid="guidCommand1PackageCmdSet" id="MyMenuGroup" /> <Icon guid="guidImages" id="bmpPic1" /> <CommandFlag>TextChanges</commandflag></icon></parent></button></buttons>
方法 スタートメニューで「Visual Studio 2017」フォルダ内の 「Reset the Visual Studio 2017 Experimental Instance」を選択する
ソースコード var dte = ServiceProvider.GetService( typeof( _DTE ) ) as _DTE; if ( dte == null ) return; var activeDocument = dte.ActiveDocument; if ( activeDocument == null ) return; var textDocument = activeDocument.Object() as TextDocume…
概要 https://www.microsoft.com/en-us/download/details.aspx?id=35825 上記のページにアクセスして、「Download」ボタンを押して、 「Choose the download you want」の欄で ダウンロードしたいアイコンセットをチェックして「Next」ボタンを押す
はじめに この記事では Visual Studio 2017 で メニューにコマンドを追加する拡張機能を作成する方法を紹介していきます 検証環境 Visual Studio Community 2017 手順 プロジェクトの準備 Visual Studio メニューの「ファイル>新規作成>プロジェクト」を選択…
概要 Visual Studio 2017 をまだインストールしていない場合 Visual Studio 2017 をインストールする時に 「Visual Studio 拡張機能の開発」をチェックしてインストールします Visual Studio 2017 を既にインストールしている場合 Visual Studio メニューの…
検証環境 Visual Studio 2017 概要 private void MenuItemCallback( object sender, EventArgs e ) { Object selectedObject = null; var monitorSelection = Package.GetGlobalService( typeof( SVsShellMonitorSelection ) ) as IVsMonitorSelection; moni…
検証環境 Visual Studio 2017 概要 private void MenuItemCallback( object sender, EventArgs e ) { Object selectedObject = null; var monitorSelection = Package.GetGlobalService( typeof( SVsShellMonitorSelection ) ) as IVsMonitorSelection; moni…
ソースコード var fullPath = projectItem.Properties.Item( "FullPath" ).Value.ToString();
はじめに <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_XPROJ_PROJITEM"/> コンテキストメニューにコマンドを追加して 拡張機能を実装する時に使用できる ID をまとめました リスト ID 対象 IDM_VS_CTXT_CODEWIN コードウィンドウ IDM_VS_CTXT_FOLDERNODE フォルダ IDM_VS_CTXT_ITEMNODE 項目 IDM_VS_CTXT_PROJNODE プロジ</parent>…
文字を変更する var statusBar = ServiceProvider.GetService( typeof( SVsStatusbar ) ) as IVsStatusbar; statusBar.SetText( "ピカチュウ" ); プログレスバーを表示する var statusBar = ServiceProvider.GetService( typeof( SVsStatusbar ) ) as IVsSta…