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:
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.
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.!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With