Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI related issues verification

I am planning to develop visual studio Add-in to verify UI related issues of visual c++ project. Following will be requirement of the project:

  1. In my project some accelerator keys are reserved for some menus like, “O” is reserved for open file and “S” is reserved for save project. Likewise 15 keywords are reserved by rest of project. I cannot use those 15 accelerator keys in my visual c++ dialog.

Requirement:I want to create Microsoft add-in say “Verify accelerator Key”. This add-in will provide me one menu in visual studio environment. On click of menu I want to take each and every control from dialog and check whether provided accelerator key is belonging to reserved 15 keys or not. If any control accelerator key belongs to 15 reserved keys then I will request developer with error to change accelerator key.

This functionality will be similar to “Check Mnemonics” present in visual studio but for different purpose.

  1. Alignment in dialog: In visual c++ project, we are continuously facing issue that, controls on dialog should be aligned to each other i.e. top control on dialog should be on same line with last control vertically as well as rightmost control on dialog should be on same line with leftmost control horizontally.

I want to check alignment of each control.

Please provide me any guidance from where I can start or reference code, document ETC.

Thank You for reading.!

like image 689
Santosh Dhanawade Avatar asked Oct 30 '15 13:10

Santosh Dhanawade


1 Answers

Look this page for a good overview of what you can extend in VS (which is a lot): https://www.visualstudio.com/en-us/integrate/explore/explore-vside-vsi.aspx

In particular: the Rosyln Compiler Extensions lets you read (and even modfy) the code in a very semantic way (i.e. you can programmatically 'search' the code tree for the AcceleratorKey property).

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

It's been a while, but I've experimented with the "CompilerServices" namespace before. Assuming the VS Addin SDK gives you some sort of handle to the current project's code tree, you could walk all functions, looking for assignment statements, filtering on the type(s) 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

like image 125
modal_dialog Avatar answered Oct 01 '22 01:10

modal_dialog