visual-studio-extensions

How can you make the file get added to the recent projects MRU list when programatically opening a solution in VS?

╄→гoц情女王★ 提交于 2019-12-02 18:45:56
问题 When a solution is programmatically opened in an add-in/extension (VS2012 in my case) using Solution.Open, the solution file is not added to the projects MRU (i.e. File->Recent Projects and Solutions menu) as it would be if you opened the solution using the File->Open->Project/Solution menu. Is there a way to force the file to be added? I've seen some references to manipulating the registry (e.g. HKCU\Software\Microsoft\VisualStudio\11.0\ProjectMRUList ) but is there another way that doesn't

Insert a new GUID to Visual Studio 2012

﹥>﹥吖頭↗ 提交于 2019-12-02 16:42:16
Is it possible to create a code snippet or something similar to automate the process of generating and inserting GUIDs in to the text editor in Visual Studio 2012? I frequently need to generate new GUIDs (WiX installer for example, as well as our own internal framework). I used to use a macro to perform this job, creating a new GUID and then inserting it in to the current ActiveDocument. I would the bind the macro to Shift-Ctrl G so I could rapidly insert a new ID without having to launch the Create Guid tool and copy from there. Macro functionality has now been removed from Visual Studio 2012

Visual Studio Text Editor Extension

女生的网名这么多〃 提交于 2019-12-02 14:14:54
I am trying to get started in Visual Studio (2010) extensions and I am having a hard time finding the right materials. I have the SDK, but the included samples seem to be things like adorners, windows, and icons. I am trying to make an extension that will work directly with the text editor (to alphabetize all of my method names in a class, or make all constant names upper case for example) but I can't find a demo for this type of functionality, or even a tutorial. Does anyone know where I can find this kind of stuff? I had the exact same question and now have browsed the web several hours

How can you make the file get added to the recent projects MRU list when programatically opening a solution in VS?

陌路散爱 提交于 2019-12-02 12:45:43
When a solution is programmatically opened in an add-in/extension (VS2012 in my case) using Solution.Open , the solution file is not added to the projects MRU (i.e. File->Recent Projects and Solutions menu) as it would be if you opened the solution using the File->Open->Project/Solution menu. Is there a way to force the file to be added? I've seen some references to manipulating the registry (e.g. HKCU\Software\Microsoft\VisualStudio\11.0\ProjectMRUList ) but is there another way that doesn't assume the storage that VS uses and therefore would be less likely to break in the future? Perhaps a

Run script when finished saving file - Visual Studio Extensibility

我只是一个虾纸丫 提交于 2019-12-02 11:56:11
Can someone give me some sample code for Visual Studio Extensibility where I can grab the text from a document, when the Save event ends, and run a script in C # with that text (example, trigger a Web service for certain file extensions). It could also be a new button (for example, save in the web service). You can subscribe to the DocumentSaved event: events = DTE.Events; documentEvents = events.DocumentEvents; documentEvents.DocumentSaved += OnDocumentSaved; In the OnDocumentSaved handler with EnvDTE.Document you can get the document path as doc.FullName . To get text from EnvDTE.Document:

Issues Proffering Language Service

给你一囗甜甜゛ 提交于 2019-12-02 08:29:01
I have found two ways of proffering a language service on the internet. The first way involves using a IOleComponentManager and registering a timer to call my service during idle times. The second way involves casing my service as an IServiceContainer and adding a ServiceCreatorCallback to "proffer the service on demand". Supposedly the second way is now the "preferred way" of doing things. Unfortunately, when I use this method, OnSynchronizeDropdowns never gets called on my TypeAndMembersDropdownBars implementation. In addition, when my LanguageService finds errors in the file, it uses

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

淺唱寂寞╮ 提交于 2019-12-02 07:39:57
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 get my service. But what about if I want to get my service from a class, which is not extends the

Show tooltip on hover over text

最后都变了- 提交于 2019-12-02 06:54:20
问题 I want to create extension that allows to show custom message when I hover over a text. E.g. "test-text" should give tooltip "OK" instead of current "ITrackin..." I tried to follow https://docs.microsoft.com/en-us/visualstudio/extensibility/walkthrough-displaying-quickinfo-tooltips?view=vs-2019 but people are stating that it is not working and it's quite long way of doing this. I cannot find any more docs on this. I know how to display it in on-click window/get currently selected text. 回答1:

how to get the selected connection node object of VS Server Explorer window DDEX

自作多情 提交于 2019-12-02 04:36:11
I'm adding some options for the Connection Node in the server explorer for my VS extension. For one of the menu options that I have added I need to get the connection string of the very selected connection, So I have tried this by adding some code in the BeforeQueryStatus event and also in the command handler method. But looks like I'm missing something since every time I want to get an Instance of the DataViewHierarchyAccessor I always get a null value. Although if I do the same thing but in a lower level node works fine. I have used the following code with no luck:

WPF modal window in Visual Studio Extension blocking input

╄→гoц情女王★ 提交于 2019-12-02 04:31:30
Using the following tutorial , within a VSIX project, I created a WPF window that inherits from Microsoft.VisualStudio.PlatformUI.DialogWindow, and I display this modally using the following code: var myWindow = new MyWindow(myParameters); myWindow.ShowDialog(); When I compile this in RELEASE mode and start without debugging [Ctrl+F5], it opens the Experimental version of Visual Studio. Here, I open another Solution and then execute my Modal Window. The window works just fine - I can type in text boxes etc, etc. However, when I close the modal dialog window [using this.Close()], the problems