vspackage

Add context meu item to all files and folders in the solution explorer using vspackage

你。 提交于 2020-01-03 04:34:15
问题 I want to add a menu item to the context menu of all the files and folders in the solution explorer. I was able to add my menu item to the project node with this entry in the vsct file.. <Menu guid="guidERAPackageAlphaCmdSet" id="ERAInsightMenu" priority="0x0700" type="Context"> <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD" /> <Strings> <ButtonText>ERA Insight</ButtonText> <CommandName>ERA Insight</CommandName> </Strings> </Menu> I want to get this in the context menu of all

How to register key binding code on VSIX package installation

耗尽温柔 提交于 2020-01-02 07:46:10
问题 I'd like to add keyboard shortcut to Visual Studio package only once, during its installation. Basically I know how to do it from the package code, for example: var dte = GetGlobalService(typeof(DTE)) as DTE2; if (dte != null) { dte.Commands.Item("Tools.Something").Bindings = "Global::Ctrl+T, Ctrl+S"; } The problem is, I'd like to invoke this code only once (I don't want to execute this code in package class constructor, because it will execute each time the package will be used first time

How to Detect if Visual Studio IDE is closing using VSPackage?

半腔热情 提交于 2020-01-01 11:47:11
问题 I'm writing a VS Package where I need to store the time when the user start my package, and when the user close the Visual Studio. The problem is, I don't know how to get the closing event for the Visual Studio. Can anyone give me any information about how to detect if the VS is closing? Note: When I search from the internet, I got the following similar problem to mine: How do you cancel a ToolWindowPane or Visual Studio IDE close operation via a VSPackage?, but when I try it, this solution

How do you cancel a ToolWindowPane or Visual Studio IDE close operation via a VSPackage?

爷,独闯天下 提交于 2020-01-01 06:27:10
问题 I have a VSPackage with a dockable tool window containing form data. If there are unsaved changes in this form, I would like to cancel a close to either the tool window and the visual studio IDE if the user clicks cancel on saving changes before closing. I can perform the save test on close, but I don't see any event handler methods or other options to actually cancel the close. Here is some blurb from the package: private DTE2 _applicationObject = null; ///-----------------------------------

How do you cancel a ToolWindowPane or Visual Studio IDE close operation via a VSPackage?

前提是你 提交于 2020-01-01 06:27:09
问题 I have a VSPackage with a dockable tool window containing form data. If there are unsaved changes in this form, I would like to cancel a close to either the tool window and the visual studio IDE if the user clicks cancel on saving changes before closing. I can perform the save test on close, but I don't see any event handler methods or other options to actually cancel the close. Here is some blurb from the package: private DTE2 _applicationObject = null; ///-----------------------------------

how to get the selected connection node object of VS Server Explorer window DDEX

こ雲淡風輕ζ 提交于 2019-12-31 04:23:10
问题 I'm adding some options for the Connection Node in the server explorer for my VS extension. For one of the menu options that I have added I need to get the connection string of the very selected connection, So I have tried this by adding some code in the BeforeQueryStatus event and also in the command handler method. But looks like I'm missing something since every time I want to get an Instance of the DataViewHierarchyAccessor I always get a null value. Although if I do the same thing but in

VSIX Package doesn't include referenced project's dependencies

久未见 提交于 2019-12-30 04:56:07
问题 We have a visual studio package (VS Package) that references a class library project (Project A). Project A in turn references another class library project (Project B). So the dependency structure looks like this: VS Package > Project A > Project B All projects exist inside the same solution and the dependencies have been set up as proper project references. If I build the package in visual studio and look in the bin/Debug folder all necessary assemblies are there including Project B's.

Finding a ProjectItem by type name via DTE

廉价感情. 提交于 2019-12-29 04:46:06
问题 Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010. The closest I could find is Solution.FindProjectItem, but that takes in a file name. Thanks! 回答1: I've been trying to do something similar, and have come up with the following, which simply searches through namespaces and classes until it hits the one you're looking for. It seems to work in most cases although when

Finding a ProjectItem by type name via DTE

烈酒焚心 提交于 2019-12-29 04:46:05
问题 Given a type name, is it possible to use DTE to find the ProjectItem that the type is located in? Something similar to how the Navigate To... dialog works in Visual Studio 2010. The closest I could find is Solution.FindProjectItem, but that takes in a file name. Thanks! 回答1: I've been trying to do something similar, and have come up with the following, which simply searches through namespaces and classes until it hits the one you're looking for. It seems to work in most cases although when

Obtain a PLK for a 2005/2008 VSPackage

▼魔方 西西 提交于 2019-12-25 07:49:50
问题 Our VS extension still needs to support VS 2005 and 2008, but I cannot generate a VSPackage PLK anymore - the system seems to be either broken or no longer supported by Microsoft. There is an MSDN page: How to: Obtain a PLK for a VSPackage, but steps described there no longer work on the new VS Extesibility website. Does anybody know whether creation of new VSPackages (signed with PLK) is still supported for VS 2005 and 2008? If so, where to go for the PLKs? 回答1: Enroll the VSIP Program