visual-studio-addins

my vs2008 addin for textformatting is awfully slow

你离开我真会死。 提交于 2019-12-05 18:22:07
i wrote a little addin, which does some formatting of my C# code. in the addins Exec method i do the following try { TextSelection selection = (EnvDTE.TextSelection)_applicationObject.ActiveDocument.Selection; String foo = String.Empty; if (!text.IsEmpty) { foo = someCoolObjectThatFormatsText.Format(selection.Text); selection.Text = foo; // here everything gets painfully slow :-( } } catch (Exception) { throw; } when the line with the code "SelectedText.Text = foobar;" is call, VS rebuilds each line of the selection step by step. You can easily watch it doing this step. But i don't get, why it

How do I write to the output window in Visual Studio 2010 AddIn?

我与影子孤独终老i 提交于 2019-12-05 02:09:45
I'm writing a simple Visual Studio 2010 Add-In to do a common copying job here at work (getting dlls from libs sln). I want the progress of the copying to be written to the output window. I tried Trace.WriteLine(...) expecting that to make it, but it doesn't when I run the add-in in the debugger. I have not tried it any other way yet. I found some examples of doing that in Visual Studio 2008, but the required libs are not available to reference. Can anyone point me to how to write to the output window? My googling skills have failed me. I've done this for a macro I wrote: Window window = dte

VS 2010 addin: getting selected text in the editor

可紊 提交于 2019-12-04 18:14:51
Coders, I am developing an add in for VS2010 and I am trying to get the selected text in the code editor. so far, i have been searching many webpages and thy all seems to use DTE.ActiveDocument which causes an error in my code. I have written two versions of a method that suppose to return a selected text in the editor but I still get the same error over and over: the error is: An object reference is required for the non-static field, method, or property 'EnvDTE._DTE.ActiveDocument.get' and here are my two versions of the method (only relevant code is showen): using EnvDTE; private string

How do I extend the project properties screen in Visual Studio?

白昼怎懂夜的黑 提交于 2019-12-04 12:01:19
问题 When u view a project properties in Visual Studio u get a number of tabs. The standard ones are "Application", "Build", "Build Events" etc. It is also possible to add custom tabs. For example view the properties of a WebApplication or a VSIX project you get different (extra) tabs. So how do I write a VSIX addin that adds a custom tab to the project properties windows? 回答1: Check out this article: How to: Add and Remove Property Pages. You create a page like so: class DeployPropertyPage : Form

How would I retrieve the fully qualified name of an identifier in a VS macro?

拜拜、爱过 提交于 2019-12-04 09:00:38
I'm trying to resolve the fully qualified name of a c# identifier at a certain point (cursor) of a code window, using a Macro (or even an Add-in) in Visual Studio 2008. For example, if the cursor is in "Rectangle", I would like "System.Drawing.Rectangle" returned. I've tried FileCodeModel.CodeElements and .CodeElementFromPoint but they only retrieve the containing method or class (and others). If this can't be done using a macro or add-in (even though VS does know the information via intellisense), would it be possible to use Reflection read in the c# file and get the desired info? It can be

Developing Visual Studio addins for multiple versions of Visual Studio

本秂侑毒 提交于 2019-12-04 07:05:22
I've been given the task of developing some extensions for Visual Studio for our internal use. These will have to support a couple of different versions of Visual Studio (VS2008, 2010 and 2012 - VS2005 would be a nice to have but not essential). I'd like to develop these in as consistent a way as possible, reusing as much of the code as possible, while fitting it into the existing project structure for these kinds of tools, which is a Visual Studio 2012 .sln. What's the best / easiest way of developing this kind of extension? A VSPackage project? Can I make a 2008-compatible VSPackage which is

What are the best Visual Studio addins? [closed]

China☆狼群 提交于 2019-12-03 21:02:01
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I currently use Resharper and have for a few years now. I know there are a ton of other useful addins out there but i never seem to

How do I extend the project properties screen in Visual Studio?

Deadly 提交于 2019-12-03 07:36:20
When u view a project properties in Visual Studio u get a number of tabs. The standard ones are "Application", "Build", "Build Events" etc. It is also possible to add custom tabs. For example view the properties of a WebApplication or a VSIX project you get different (extra) tabs. So how do I write a VSIX addin that adds a custom tab to the project properties windows? Check out this article: How to: Add and Remove Property Pages . You create a page like so: class DeployPropertyPage : Form, Microsoft.VisualStudio.OLE.Interop.IPropertyPage { . . . . //Summary: Return a stucture describing your

Visual Studio add-on gallery?

喜夏-厌秋 提交于 2019-12-03 07:30:55
i'm hoping to find some add-ons for Visual Studio to address some specific usability issues. Is there a Visual Studio addons gallery that contains a huge dumping ground of addons that every person, company, yahoo and hick have created? Kind of like Vista Sidebar Gadget gallery , but for addons. Kind of like CodePlex , but for addons. Is Visual Studio Gallery it? Not that it's important to my question, but some of the IDE functionality i was hoping to see addressed through addons: tabs are placed in chronological open order renaming a control renames attached event handlers deleting all code

Tool Comparison: Visual Assist X and Resharper

﹥>﹥吖頭↗ 提交于 2019-12-03 06:30:25
问题 .NET developers out there! Need your opinion here! I am now using Visual Assist X, a decent piece of software, indeed. But the .NET bloggers seem to prefer Resharper more. I might want to consider a switch over, but before that I want your guys opinion first. 回答1: Resharper is much better for C# code (and supposedly VB.Net, but I haven't tried that). Unfortunately there is no support for C/C++, so if you need that, you might want to keep Visual Assist around. They don't coexist very well,