UI 相关问题验证

UI related issues verification

我打算开发visual studio插件来验证Visual C++项目的UI相关问题。 以下将是项目的要求:

  1. 在我的项目中,一些快捷键是为某些菜单保留的,例如“O”是为打开文件保留的,“S”是为保存项目保留的。同样,项目的其余部分保留了 15 个关键字。我无法在我的 Visual C++ 对话框中使用那 15 个加速键。

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.

此功能类似于 visual studio 中的“检查助记符”,但用途不同。

  1. 对话框中的对齐方式: 在 Visual C++ 项目中,我们一直面临的问题是,对话框上的控件应该彼此对齐,即对话框上的顶部控件应该与最后一个控件在垂直方向上位于同一行,以及对话框上最右边的控件应该与最左边的控件在同一行上横向。

我想检查每个控件的对齐方式。

请提供我可以从哪里开始或参考代码、文档 ETC 的任何指导。

感谢您的阅读!

查看此页面以全面了解您可以在 VS 中扩展的内容(很多):https://www.visualstudio.com/en-us/integrate/explore/explore-vside-vsi.aspx

特别是:Rosyln 编译器扩展允许您以非常语义化的方式阅读(甚至修改)代码(即您可以以编程方式 'search' AcceleratorKey 属性 的代码树)。

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

已经有一段时间了,但我之前已经尝试过 "CompilerServices" 命名空间。假设 VS Addin SDK 为您提供了当前项目代码树的某种句柄,您可以遍历所有函数,查找赋值语句,过滤您感兴趣的类型。

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

编辑器扩展部分也可能适用: https://msdn.microsoft.com/library/dd885492.aspx