开发者

how to access current open file from custom ToolWindowPane

开发者 https://www.devze.com 2022-12-23 18:35 出处:网络
I have created ToolWindowPane (ToolBar for VS2008) using VSPackage but I am not able to access current opened file by the user. Is there any way to do this ?

I have created ToolWindowPane (ToolBar for VS2008) using VSPackage but I am not able to access current opened file by the user. Is there any way to do this ? I wrote following code which travels through project and find out all element开发者_运维技巧s in opened solution.

EnvDTE.DTE dte = (EnvDTE.DTE)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(EnvDTE.DTE));

But not able to get reference of open file by user I also want each time user change focus from one file to another my toolbar should refresh.

Thanks in advance


You could try using the events model?

http://msdn.microsoft.com/en-us/library/envdte.events.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号