DSL. Is it possible to add commands to context menu item dynamically? - visual-studio

I have DSL Diagram builted in Visual Studio 2012 Ultimate.
And I want to duplicate TFS functionality like in standard UML Diagrams in Visual Studio ( In my case Visual Studio 2012 Ultimate ). And I have one issue - Types of work items are different in different TFS projects types, which means that I need to add commands in run time. And I don't know how to add some commands to Context Menu dynamically. Is there any way?

I found the answer:
How to: Dynamically Add Menu Items
http://msdn.microsoft.com/en-us/library/vstudio/bb166492.aspx

Related

Is there a feature in VIsual Studio or Resharper that can extract XAML into a separate file?

In ASP.NET Forms and MVC, you can select a block of code and extract it into a separate user control or file using Resharper and possibly Visual Studio. I cannot find such a feature for XAML. Does it exist in either Resharper or Visual Studio? If so, how do you perform this action?
I think you are looking for this:
https://www.jetbrains.com/help/resharper/ReSharper_by_Language__XAML__Refactorings.html
Resharper allows you to extract styles and resources, but you have to select the XAML and go to Resharper->Refactor->Extract in order to find the options, you won't see them if you use ALT+ENTER.

Refactor menu missing from Visual Studio 2015

I am having trouble finding the right-click context menu in Visual Studio 2015. I know that nothing is wrong with my project or the file I am working. I can find the right-click context refactor menu in Visual Studio 2013. However, in Visual Studio 2015 there isn't a refactor context menu in the right-click context menu.
Where did it go? How do I get it back?
Your suggestion cannot include menu Edit → Refactor.
I have tried to reset my Visual Studio settings back to default using menu Tools → Import and Export Settings and that didn't bring the menu back either.
Some of the refactoring tools have been relocated or are at least accessible in a different manner than they were previously.
Using the extract method refactor as an example, you can still use this function; it is just not done the same as before:
Right click
Quick actions
Click extract Method
I think they've changed it to feel more "ReSharper"ey. All of the functionality should still be there however.
Here's more information on refactoring in Visual Studio 2015 - hopefully this helps! Refactoring (C#)
You no longer need to access the refactoring using the mouse right click.
It is recommended that you use the keyboard shortcut keys within Visual Studio.
For all possible shortcut keys, see Default Keyboard Shortcuts in Visual Studio, Refactor.
You might need to build the project to get it to work.
See Code Editing ASP.NET Web Forms in Visual Studio 2013 | Microsoft Docs. (If it is missing then the point is that I am using an example provided by Microsoft.). In Refactoring and Renaming see To extract a method in a C# page. When I follow the instructions I cannot find the feature to extract the code to a method. When I tried the Edit menu it said I did not have valid code. Then I built the project and the feature to extract the code was available and worked.
If you change the name of the object you are refactoring, the light bulb then appears to the left which asks if you wish to change the name of the object (i.e. refactor) or generate a new constructor for the new named object.
Ctrl + . is the shortcut key for extracting a method in Visual Studio 2015 and onward.
Ctrl+M, R does not work anymore in new versions.

Visual Studio context menu/toolbar Set StartUp Projects

I am hoping to put a toolbar button (or configure a keyboard shortcut) for the Set StartUp Projects... solution context menu item.
If the solution is selected in Solution Explorer the Project menu has solution context items, but I cannot seem to find this command anywhere. I can only find single Set as StartUp Project and similar.
Does anyone know if I can do this?
EDIT: I found this extension which allows me to do what I want quite easily (define different combinations of start up projects): https://visualstudiogallery.msdn.microsoft.com/f4e1be8c-b2dd-4dec-b273-dd88f8818571
It is the one command Project.SetasStartUpProject that works differently depending on whether a project or the solution is selected in Solution Explorer. To select the solution and then call Project.SetasStartUpProject you can probably use Visual Commander or Macros for Visual Studio 2013.
This extension does exactly what I required. It has linked versions for other editions of VS. It uses json config files to start multiple projects nicely.

Filtering the Visual Studio toolbox

Does anyone know if it is possible at all to filter the Toolbox's items in Visual Studio using an add-in?
Visual Studio 2010 introduced the ability to search but I want to filter, for example: type in button and it must show all items containing "button", same as on this on this Delphi XE screenshot:
This is a very good answer for this question. I copied from the VS blog:
In VS 2010 Beta2, we’ve added the ability to search for controls in the toolbox by name. To use it, put focus in the toolbox (by clicking in it, for example) and start typing the name of the control you want to find. As you type, the selection will move to the next item that matches what you've typed so far.
http://blogs.msdn.com/b/visualstudio/archive/2009/10/26/toolbox-search.aspx
This is something not possible as microsoft does not reveal the secret of adding toolbox controls details completely. They make change the process for each platform and for each versions of visual studio. if we have a clear details of how they add, we can also do the similar kind of small application with search capability and add it as add-in.
Luckily Visual Studio 2012 now has that feature!

How add an item template to Visual Studio 2010

Let me elaborate, since the title was a little rough. I have been looking for a way to make a WCF service work with Silverlight for days now. Eventually I come across a mention of something called a 'Silverlight-enabled WCF service'. The only problem is, this doesn't exist in my Visual Studio 2010 (and I have looked).
Someone then asked me whether it appears in Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Silverlight\1033. Well it looks to be - there is a file called SLWcfService.zip.
Assuming this is the template I'm looking for, how do I get Visual Studio to add this to the list of item templates that I get when I select a new project?
Thanks.
I don’t about your specific case, but if you have an item up on VS and you want to save it as a template: Click on: File -> Export Template -> and then select Item Template.

Resources