vsx

how can i add a new icon to a Visual Studio 2010 extension?

夙愿已清 提交于 2019-12-23 01:55:09
问题 i'm developing a Visual Studio 2010 extension, i already have a toolbar inside my window. on that toolbar i have a button that i want to give an icon - my own icon! I've read this article and it is great but... it explains how to replace the icons. i want to add an additional icon. how do i achieve that? 回答1: First, add the bitmap and set its build action to Resource Remember, shocking pink = transparent (damn you, old school!) Then, in your vsct file, add the image to the bitmaps section

my vs2008 addin for textformatting is awfully slow

倖福魔咒の 提交于 2019-12-22 10:15:03
问题 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

Visual studio: automatically update C++ cpp/header file when the other is changed?

你。 提交于 2019-12-22 08:14:09
问题 For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly. Some people have mentioned http://www.lazycplusplus.com/ in response to a similar question, but it seems that that's a command line tool which would require saving and

How do I programmatically find out the Action of each StartUp Project in a solution?

断了今生、忘了曾经 提交于 2019-12-22 04:41:30
问题 Under Solution->Properties, I can set multiple start-up projects: I know that I can get the list of projects marked with "Start" (by using EnvDTE: solution.SolutionBuild.StartupProjects ), but how do I get the list of projects whose action is "Start without debugging"? They do not appear in the list. 回答1: I don't think this is documented and available officially, but here are some information: This is stored in the solution's .SUO file by the Visual Studio built-in package. The SUO file has

MVC T4 MvcTextTemplateHost and Customized “Controller” T4 Template

我们两清 提交于 2019-12-21 17:41:47
问题 I am creating my own custom T4 Template that integrates with an ADO.NET Entity Framework Model (.edmx file) included in my MVC Web Application. For Reference Please take a brief look at the following two URLs. Scott Hanselman - "T4 Code Generation Visual Studio Best Kept Secret" Visual Web Developer Team Blog - Quick Start Guide for ASP.NET MVC Developers Short Description of What I am trying to Achieve Use the T4 engine to generate the MVC Controller class with Action methods based on the

Subscription to DTE events doesn't seem to work - Events don't get called

我的梦境 提交于 2019-12-21 03:52:39
问题 I've made an extension inside a package and I am calling the following code (occurs when a user presses a button in the toolbar): DocumentEvents documentEvents = (DTE2)GetService(typeof(DTE)); _dte.Events.DebuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode; _dte.Events.DebuggerEvents.OnEnterDesignMode += DebuggerEvents_OnEnterDesignMode; _dte.Events.DebuggerEvents.OnContextChanged += DebuggerEvents_OnContextChanged; _dte.Events.DocumentEvents.DocumentSaved += new

Visual Studio plug-ins development, first steps

旧时模样 提交于 2019-12-20 10:33:44
问题 I would like to make a plug-in for visual studio... But I have no idea where to start. While it was quite easy to find guides for Eclipse plug-in development, I'm having troubles to find a good guide for VS plug-in development. I guess what I'm trying to ask here, is where do I start? 回答1: I suggest to start here: http://www.mztools.com/resources_vsnet_addins.aspx This is great set of resource for VS add-in developers. Creating VS add-in is quite easy. Some keywords if you want to search for

How to register my service as a global service or how can I use MEF in my scenario?

筅森魡賤 提交于 2019-12-20 07:33:09
问题 I would like to create my own service with global visibility. To implement that, I followed this sample solution. Everything goes well, I can call my service within a class, which extends from the Package abstract class, in this way: public class ClientPackage : Package { private void GetGlobalServiceCallback(object sender, EventArgs args) { IMyGlobalService service = GetService(typeof(SMyGlobalService)) as IMyGlobalService; } } Because I'm in a Package, I can easily call GetService and I can

Show a Visual Studio Extension Toolbar by default

徘徊边缘 提交于 2019-12-19 10:21:52
问题 In a Visual Studio extension, I have defined a Toolbar in my .vsct file as: <Menu guid="guidVsCmdSet" id="MyToolbar" type="Toolbar" > <CommandFlag>TextChanges</CommandFlag> <CommandFlag>DefaultDocked</CommandFlag> <Strings> <ButtonText>My Tools/ButtonText> </Strings> </Menu> When I launch my extension in Visual Studio Experimental hive, I can open my Toolbar manually via right clicking in the CommandBar area. Is there any way to have the toolbar show up by default when I first run the

How do I programmatically refresh/reload a VS project after modifying the underlying file?

痴心易碎 提交于 2019-12-19 03:23:15
问题 I am developing a Visual Studio package and I have written some code that will make a file in Solution Explorer dependant upon another file. What this means is that it gives them the same relationship as code-behind files or designer files, where they appear nested under the parent file with a plus/minus icon. + MainForm.cs - MainForm.cs MainForm.Designer.cs MainForm.resx The code that I have written successfully and correctly modifies the underlying project file, however the change is not