envdte

How can I get IWpfTextView for EnvDte.ActiveDocument?

China☆狼群 提交于 2021-02-07 14:24:31
问题 I am trying to manipulate the Visual Studio Text Editor scrollbar values. The problem is that I have only the dte.ActiveDocument and it is not possible to do it from there. My extension is loaded only once when VS starts and I capture dte.Events.CommandEvents. At some point I want to change the scrollbar values for the ActiveDocument. To do this I need IWpfTextView or ITextView. Do you have any idea how can I get an instance of that object? internal class MyExtension { private CommandEvents

Getting “Index was outside the bounds of the array.” while calling EnvDTE80.ErrorItems.item()

…衆ロ難τιáo~ 提交于 2021-01-27 07:00:39
问题 I was trying to get all the error in the Visual Studio 2015 Error List window but I am getting an index out of bound exception while trying to access the ErrorItem through errors.Item(i) call. Am I missing any casting ? EnvDTE80.DTE2 dte2 = ServiceProvider.GetService(typeof(EnvDTE.DTE)) as DTE2); ErrorItems errors = dte2.ToolWindows.ErrorList.ErrorItems; for (int i = 0; i < errors.Count; i++) { ErrorItem item = errors.Item(i); } 回答1: The ErrorItems.Item method seems to need an absolute index,

Setting cursor position with Visual Studio Extension

杀马特。学长 韩版系。学妹 提交于 2020-11-30 12:03:05
问题 I'm writing my own Visual Studio 2010 Extension that should help me navigating a rather large solution. I already have a dialog based VS Extension that shows me a class name and a function name depending on some search criteria. I now can click this class/method and I then already can open the correct file and jump to the function. What I now want to do is to set the cursor at the start of that function. My code to jump to the function is: Solution currentSolution = ((EnvDTE.DTE)System

How can I programmatically examine the stack in my Visual Studio extension?

随声附和 提交于 2020-08-11 18:42:13
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

How can I programmatically examine the stack in my Visual Studio extension?

為{幸葍}努か 提交于 2020-08-11 18:40:04
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

Getting DTE for running Visual Studio instances from PowerShell

六月ゝ 毕业季﹏ 提交于 2020-06-16 19:21:32
问题 Getting DTE for a single running Visual Studio with PowerShell is easy: Get a handle on the running Visual Studio instance (DTE) from powershell Getting DTE for multiple instances with C# has been solved How do I get the DTE for running Visual Studio instance? Now how do I get DTE for multiple VS instances with PowerShell? I'm trying to enable scripts to adjust VS configuration and start a build after a git pull, VM+XDE setup etc, all without having to open a new VS window if there's one

Getting DTE for running Visual Studio instances from PowerShell

孤街醉人 提交于 2020-06-16 19:21:08
问题 Getting DTE for a single running Visual Studio with PowerShell is easy: Get a handle on the running Visual Studio instance (DTE) from powershell Getting DTE for multiple instances with C# has been solved How do I get the DTE for running Visual Studio instance? Now how do I get DTE for multiple VS instances with PowerShell? I'm trying to enable scripts to adjust VS configuration and start a build after a git pull, VM+XDE setup etc, all without having to open a new VS window if there's one

How to get a programmable interface to the Visual Studio Call Stack window?

青春壹個敷衍的年華 提交于 2020-01-23 02:56:19
问题 I am working on a Visual Studio add-in (part of the ILSpy open source project) and I want to get information about the currently selected stack frame in the Visual Studio Call Stack window. I tried this: var callstackWindow = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.GetToolWindow("Call Stack"); However it throws an exception when not debugging (and Call Stack window not present) and returns null when the Call Stack window is present. There is a vsWindowTypeCallStack

How to get expanded path from EnvDTE / VCProjectEngine

老子叫甜甜 提交于 2020-01-16 16:59:52
问题 I am trying to write a tool to create a zip file containing all PDBs files from one Visual Studio 2010 solution. I can get every PDB filepath in the solution with the following code. However, the property value contains Visual Studio macro like $(TargetDir), $(TargetName) and so on. Is there a function in the EnvDTE API to expand those macros to their current values ? On the other hand, any other methods that would achieve my initial goal are also welcome ! Thanks System.Type t = System.Type

How to get expanded path from EnvDTE / VCProjectEngine

风流意气都作罢 提交于 2020-01-16 16:59:14
问题 I am trying to write a tool to create a zip file containing all PDBs files from one Visual Studio 2010 solution. I can get every PDB filepath in the solution with the following code. However, the property value contains Visual Studio macro like $(TargetDir), $(TargetName) and so on. Is there a function in the EnvDTE API to expand those macros to their current values ? On the other hand, any other methods that would achieve my initial goal are also welcome ! Thanks System.Type t = System.Type