添加代码到条目&退出每个方法。 [英] Add Code to Entry & Exit of Every Method.
本文介绍了添加代码到条目&退出每个方法。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在项目中有500个方法..
我需要解决1个简单问题。示例
private static void A()
{
Debug.Print(" Entry");
ApplicationUnderTest.Launch(path);
Debug.Print(" Exit");
}
private static void B()
{
Debug.Print(" Entry");
ApplicationUnderTest.Launch(path);
Debug.Print(" Exit");
}
private static void C()
{
Debug.Print(" Entry");
ApplicationUnderTest.Launch(path);
Debug.Print(" Exit");
}
来自以上示例:我的要求
Debug.Print(" Entry"); =>添加此行@方法条目
Debug.Print(" Exit"); =>添加此行@方法退出
如何为500方法实现此目的。
解决方案
您好,
没有自动化此过程的解决方案,至少复制/粘贴代码所需的时间更少
I have 500 Methods..in the Project.
I need to Solve 1 Simple Problem. Example
private static void A() { Debug.Print("Entry"); ApplicationUnderTest.Launch(path); Debug.Print("Exit"); } private static void B() { Debug.Print("Entry"); ApplicationUnderTest.Launch(path); Debug.Print("Exit"); } private static void C() { Debug.Print("Entry"); ApplicationUnderTest.Launch(path); Debug.Print("Exit"); }
From the Above Example: My Requirement
Debug.Print("Entry"); = > Add this Line @ the Entry of the Method
Debug.Print("Exit"); = > Add this line @ the Exit of the Method
How can I Achieve this for 500 Method.
解决方案
Hello,
There is no solution that will automate this process, at least that would take less time that copy/pasting the code.
这篇关于添加代码到条目&退出每个方法。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文