可视化操作中涉及的代码? [英] Visualizing the code involved in an action?
问题描述
我正在努力弄清图书馆的工作原理,并希望能够可视化响应用户输入(例如按键或鼠标点击)执行哪些方法和代码行。有没有办法在.NET中执行此操作?
I am trying to figure out how a library works and I would like to be able to visualize which methods and lines of code are executed in response to user input (e.g. a keypress or mouse click). Is there a way to do this in .NET?
推荐答案
微软有一个非常好的免费工具,称为 Pex 。安装完成后,您可以右键单击一个方法并选择运行Pex Exploration。它将分析代码并显示输入以触及方法的每一部分。
There's a wonderful, free tool from Microsoft called Pex. Once installed, you can right-click a method and select "Run Pex Exploration". It will analyze the code and show you inputs to touch every part of the method.
有关更多信息,请参阅 Pex CodeDigger 。以下是其中的一个截图:
For more information, see Pex CodeDigger. Here's a screenshot of it in action:
这篇关于可视化操作中涉及的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!