User Interface Compatibility Check

I plan to create a visual studio add-on to test the UI-related problems of the C ++ visual project. The following will require a project:

  • In my project, some accelerator keys are reserved for some menus of type β€œO” reserved for an open file, and β€œS” reserved for saving a project. Similarly, 15 keywords are reserved by the rest of the project. I cannot use these 15 accelerator keys in the Visual C ++ dialog box.

Requirement: I want to create a Microsoft add-in to say, "Check Accelerator Key." This add-on will provide me one menu in visual studio Environment. When I click on the menu, I want to take each control from the dialog and check whether the accelerator key belongs to the reserved 15 keys or not. If any key of the control accelerator belongs to 15 reserved keys, then I will ask the developer to change the accelerator key with an error.

This functionality will be similar to "Check Mnemonics", present in the visual studio, but with a different purpose.

  1. Alignment in the dialog box: In the C ++ visual project, we constantly face the problem that the controls in the dialog box should be aligned with each other, i.e. the top control in the dialog box should be on the same line with the last control vertically, and the most the right control over the dialogue should be on the same line as the left-most horizontal control.

I want to check the alignment of each control.

Please provide me with any instructions where I can start or indicate a code, an ETC document.

Thank you for reading.!

+6
source share
1 answer

Take a look at this page for a good overview of what you can expand into VS (which is a lot): https://www.visualstudio.com/en-us/integrate/explore/explore-vside-vsi.aspx

In particular: Rosyln compiler extenders allow you to read (and even modfy) the code in a very semantic way (that is, you can programmatically "search" the code tree for the AcceleratorKey property).

http://roslyn.codeplex.com/wikipage?title=Samples%20and%20Walkthroughs&referringTitle=Home

Some time passed, but I was already experimenting with the namespace "CompilerServices". Assuming that the VS Addin SDK gives you some kind of handle in the current tree of project code, you can go through all the functions, look for assignment instructions, and filter the types you are interested in.

https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices(v=vs.110).aspx

The Editor Extensions section may also apply: https://msdn.microsoft.com/library/dd885492.aspx

+1
source

All Articles