[英]Automate a command in Visual Studio Immediate Window
Whenever I want to know the caller controller/action of a View (in debug mode), I use two following commands in Visual Studio Immediate Window. 每当我想知道视图的调用方控制器/操作(在调试模式下)时,我都会在Visual Studio立即窗口中使用以下两个命令。
@ViewContext.Controller.ValueProvider.GetValue("controller").RawValue
@ViewContext.Controller.ValueProvider.GetValue("action").RawValue
Is there any way to automate this process instead of typing them in Immediate Window all the time? 有什么方法可以自动执行此过程,而不是始终在“即时窗口”中键入它们? or any better way to find out the Caller? 还是找到来电者的更好方法?
Update: 更新:
By automating I mean adding a shortcut key to execute this command or adding a Menu Item to the Context Menu. 通过自动化,我的意思是添加执行该命令的快捷键或将菜单项添加到上下文菜单。
I know that there is no need to type and I can hit up arrow key. 我知道不需要输入,可以按向上箭头键。 However, I need a more robust method. 但是,我需要一种更可靠的方法。
1- if you use the 'up arrow' inside the 'Immediate Window' then the last instrcution will appear for you, you just then need to press the 'enter' key to execute it. 1-如果您在“立即窗口”中使用“向上箭头”,则最后一个提示将为您显示,此时您需要按“输入”键来执行它。
2- Why not to use the 'watch' panel, it could save this for you, and it will update whenever the value has changed 2-为什么不使用“监视”面板,它可以为您保存该面板,并且只要值更改,它就会更新
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.