vspackage

Activate Visual Studio's Output window using DTE

ぐ巨炮叔叔 提交于 2019-12-11 13:43:54
问题 I've created a custom output window pane for my VSPackage : Using this code: // Creating Output Window for our package. IVsOutputWindow output = GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; Guid guildGeneral = Microsoft.VisualStudio.VSConstants.OutputWindowPaneGuid.GeneralPane_guid; int hr = output.CreatePane(guildGeneral, "Codex", 1, 0); hr = output.GetPane(guildGeneral, out ApplicationConstants.pane); ApplicationConstants.pane.Activate(); QUESTION How can I select the Output tab

Run Visual studio vs package in custom Hive (not Exp)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 10:14:14
问题 I'm developing a VsPackage and try to test it under Hive other then the Exp. I created a new Hive using the vs developer command prompt using the following command: devenv /rootsuffix MyExp And than run VS with /rootsuffix MyExp command line arguments, but failed to make my extension work on that hive . Only when I run it under the Exp it work. The main reason that I don't want to run it under the Exp hive is that I don't want to effects other extension on the hive. 回答1: After searching the

Call function of Visual Studio Package

拈花ヽ惹草 提交于 2019-12-11 09:37:29
问题 I have created a new Visual Studio Package that when loaded creates a Tool Window that looks like this: It is comprised of some controls with canvases and such that draw shapes in 2 or 3 dimensions. Right now they work in the initialization step to create the objects you see above. For this tool to be useful I would like to call a method on those controls to pass it other objects to draw. For example, I am debugging some code with points and lines and want to see them graphically. (Perhaps

How to capture Visual Studio commands in a VSPackage Plugin?

二次信任 提交于 2019-12-11 07:42:54
问题 I'm trying to make a plugin that captures the edit.copy command of visual studio, and skips it if nothing is selected. I have installed the Visual Studio SDK and created a VSPackage project. My initialize method curently looks like the following: private EnvDTE.DTE m_objDTE = null; protected override void Initialize() { Debug.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); m_objDTE = (EnvDTE.DTE)GetService(typeof

Add two or more Tool Window into the same Visual Studio project

故事扮演 提交于 2019-12-11 06:56:49
问题 I was trying to add a second tool window to a VSPackage project in Visual Studio, I have a project with a tool window already created usin the wizard provided by Visual Studio when a VSPackage project is created, I was surfing the web looking for some tutorial that can help me adding a second tool window to my existing VSPackage project. I have read several articles about tool windows but I can't get with a solution. I create a new class using System; using System.Collections; using System

Invoking standard “File changed outside Visual Studio” dialog

不羁岁月 提交于 2019-12-11 06:48:33
问题 I have succesfuly created custom single view editor in my VSPackage. One of many things I had to cope with was reacting to situation when edited file was changed outside Visual Studio - "standard" editors in Visual Studio display dialog with options like "yes", "yes to all" (reload content) etc., so if more files had changed, only one dialog is displayed. However, the only thing I can do in my VSPackage so far is display custom dialog when the file had changed. It is not pretty - when file

Dependency problems after update nuget packages of a VISX project

末鹿安然 提交于 2019-12-11 05:30:45
问题 I'm creating a VISX project. It runs normally, but after I update all it's nuget packages, it start to show errors when I try to run it in the Visual Studio Experimental Instance. I tried to revert the packages, but it seems that some packages versions are no longer available for download. The main reason is that the VISX can't load the Microsoft.VisualStudio.Threading assembly after the dependecies are updated. I tried adding the assembly to the package's Assets too. The VISX can load it now

get the text under the mouse pointer

孤者浪人 提交于 2019-12-11 04:18:20
问题 i am relatively new to C#. can anybody please tell me how to display the tool tip on the text editor...just as VS intellisense expands a particular method when we move the mouse over it??? Since i am Developing an adding i want the tool tip to be displayed on document (there is no form associated with it) how to get the text under the mouse pointer thanx in advance 回答1: Off the top of my head look at the ToolTip class. I am sure you need to supply it with the x,y coordinates of where you want

How to handle pressing any keys in the user control in visual studio vspackage

两盒软妹~` 提交于 2019-12-10 19:16:27
问题 I added usercontrol (textbox) in code editor control. But textbox not handle any keys (arrow, backspace). Keys handle code editor only. Example: get IWpfTextView var textManager = (IVsTextManager)Package.GetGlobalService(typeof(SVsTextManager)); IVsTextView textView; textManager.GetActiveView(1, null, out textView); var userData = (IVsUserData)textView; if (userData == null) return null; Guid guidWpfViewHost = Microsoft.VisualStudio.Editor.DefGuidList.guidIWpfTextViewHost; object host;

Visual Studio Extension: Get the path of the current selected file in the Solution Explorer

泄露秘密 提交于 2019-12-10 18:55:31
问题 I'm trying to create my first extension for visual studio and so far I've been following this tutorial to get me started (http://www.diaryofaninja.com/blog/2014/02/18/who-said-building-visual-studio-extensions-was-hard). Now I have a custom menu item appearing when I click on a file in the solution explorer. What I need now for my small project is to get the path of the file selected in the solution explorer but I can't understand how can I do that. Any help? ---------------------------- EDIT