vspackage

How do I programmatically add a file to a Solution?

和自甴很熟 提交于 2019-12-06 02:27:56
问题 I am developing a VS Package and part of the functionality that I need to implement is to add a file to the Solution Items of the currently open Solution. This is exactly the same action that would be performed manually if you right-click on a Solution and choose Add > Existing Item. Then selected a file on disk. I have taken a good look at the DTE and DTE2 interfaces and can see the operations to add and manipulate projects but there doesn't appear to be any operations for adding individual

Method or operation not implemented error on Binding

久未见 提交于 2019-12-06 01:07:37
问题 I'm currently developing a Visual Studio plugin (VSPackage) which finally should be able to visualize call relations. In order to represent them I want to use the Graph# library which manages the graph (avoiding overlapping edges etc.). Unfortunately I get the following error message at runtime in my XAML: XamlParseException: The method or operation is not implemented. The error pops up on the <graph:CallRelationGraphLayout Graph="{Binding RelationGraph}"/> tag. <UserControl x:Class="Biocoder

HowTo get all interfaces types from visual studio solution?

↘锁芯ラ 提交于 2019-12-05 21:05:16
I'm trying to write an extension to visual studio. I need to get a list of all the interfaces types found in all the projects in the current opened solution . So far i have tried doing this using the EnvDev namespace. Is there a way of doing this without parsing the project's .cs files ? Thanks, Chai. 来源: https://stackoverflow.com/questions/13051397/howto-get-all-interfaces-types-from-visual-studio-solution

How to register key binding code on VSIX package installation

不想你离开。 提交于 2019-12-05 20:11:39
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 after VS restart). How to do it ? There is another way I wasn't aware last time. All what need to be done

Is there a good way to stream the results from an external process into a Visual Studio output pane?

只谈情不闲聊 提交于 2019-12-05 14:47:36
I have a custom output pane set up in a VsPackage similar to the following: ///-------------------------------------------------------------------------------- /// <summary>This property gets the custom output pane.</summary> ///-------------------------------------------------------------------------------- private Guid _customPaneGuid = Guid.Empty; private IVsOutputWindowPane _customPane = null; private IVsOutputWindowPane customPane { get { if (_customPane == null) { IVsOutputWindow outputWindow = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; if (outputWindow != null) { // look

How to refresh Visual Studio settings after setting a value in a VSPackage

こ雲淡風輕ζ 提交于 2019-12-05 13:23:35
In a Visual Studio extension I have defined a VSPackage with a number of commands in it. In the handler for one of the commands, I set a user setting using the following code: SettingsManager settingsManager = new ShellSettingsManager(this); WritableSettingsStore userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); userSettingsStore.SetBoolean("Text Editor", "Visible Whitespace", true); This successfully sets the value in the registry (at HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0Exp\Text Editor in the case of the isolated shell), but the editor

Why isn't my vspackage's context menu showing

元气小坏坏 提交于 2019-12-05 01:40:08
I already have a package that I created, and I'd like to add a menu to the Code Window context menu. After a little search I found several articles explaining how to do it. The problem is, I can't get it work.... Here are my declarations in the vsct file: <Button guid="guidDALGeneratorPkgCmdSet" id="cmdidDataFlow" priority="0x0100" type="Button"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_CODEWIN"/> <CommandFlag>DynamicVisibility</CommandFlag> <Strings> <CommandName>cmdidDataFlow</CommandName> <ButtonText>Show data flow</ButtonText> </Strings> </Button> and the symbols: <GuidSymbol name=

How to deploy and register a VSPackage supporting multiple versions of Visual Studio (2005, 2008, 2010)?

我与影子孤独终老i 提交于 2019-12-04 14:21:47
问题 I have an open source VSPackage that I would like to release with support for Visual Studio 2005, Visual Studio 2008, and Visual Studio 2010. I'm trying to figure out how to create the installer and how to perform the package registration with each edition of Visual Studio. The deployment research I've done indicates my best bet for an installer is a VSIX inside an MSI. The registration research I've done is a lot less clear. VSPackage registration seems to differ for every edition (VS2005

Getting the dte2 or TeamFoundationServerExt object in a VS Package project?

情到浓时终转凉″ 提交于 2019-12-04 12:52:53
I am working on a Visual Studio Package project. This project needs a connection to our TFS. To read the current connection, I would need the TeamFoundationServerExt object, which I should be able to get from the dte2 object. Now I found hundreds of examples and most of them are working with an "_application" variable, which seems to get automatically filled, but of course not for the "Visual Studio Package" project type. How can I get the TeamFoundationServerExt object of the currently running VS2010? You should be able to do the following from a VSPackage to get the current DTE object: DTE2

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

这一生的挚爱 提交于 2019-12-04 10:57:51
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 is to detect and do something when the Package window is closed, and cannot detecting when the Visual