如何获取有关已打开的.cs文件的通知 [英] how to get notification about opened .cs file

查看:99
本文介绍了如何获取有关已打开的.cs文件的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
   我已经使用vspackage创建了工具"窗口.
   现在我运行它,它将打开一个新的Visual Studio实例,该实例将打开,然后用户将打开任何项目.然后,我想通知已打开的项目中是否打开了.cs文件.那么该怎么做呢?

hi
   I have created  Tool window using vspackage.
   now i run it, it openes new visual studio instance will open then user will open any project.then I want to get notification that in opened project whether .cs file is opened or not. so how to do that? can you please help me for that?

推荐答案

嗨Vipul,

Hi Vipul,

您可以实现IVsRunningDocTableEvents.OnBeforeDocumentWindowShow,调用IVsRunningDocumentTable.GetDocumentInfo来检索文档别名(又名文件名),如果该别名以.cs结尾,请执行其他处理.

You could implement IVsRunningDocTableEvents.OnBeforeDocumentWindowShow, call IVsRunningDocumentTable.GetDocumentInfo to retrieve the document moniker (aka the filename) and if the moniker ends with .cs, do your additional processing.

此致


这篇关于如何获取有关已打开的.cs文件的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆