以编程方式监视在visual studio中打开的选项卡(Programmatically monitoring which tab is opened in visual studio)

编程入门 行业动态 更新时间:2024-10-14 12:27:50
以编程方式监视在visual studio中打开的选项卡(Programmatically monitoring which tab is opened in visual studio)

让我们从一个示例开始,用户在Visual Studio中为解决方案>项目打开了几个选项卡(Default.aspx,Default.aspx.cs)我以编程方式想要监视devenv.exe进程并想知道哪个选项卡(文件准确无误) )用户正在努力。 如果有一些日志文件或进程对象有一些属性告诉? 或者必须完成图像处理?

Let's start with an example, User have several tabs opened for a solution>project in Visual Studio (Default.aspx, Default.aspx.cs) I programmatically want to monitor devenv.exe process and want to know which tab (file to be exact) user is working on. If there's some log file or process object has some attribute that tells? Or it has to be done with image processing?

最满意答案

您可以为Visual Studio编写扩展并监视DTE.Events.WindowEvents.WindowActivated 。 在活动窗口中,您可以获取文件用户正在处理的Document.FullName 。

请参阅例如状态栏中活动窗口的显示文档路径 。

You can write an extension for Visual Studio and monitor DTE.Events.WindowEvents.WindowActivated. From an active window you can get Document.FullName for a file user is working on.

See for example Display document path of the active window in the status bar.

更多推荐

本文发布于:2023-08-02 23:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1381920.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项卡   方式   studio   visual   opened

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!