我的语言服务的Parser.cs文件中的GetService DTE请求 [英] GetService DTE request in Parser.cs file of my language service
问题描述
我正在我的托管语言服务的parser.y/parser.cs文件中尝试执行以下操作,并且理解我在GetService上遇到错误.
I am trying to do the following in my parser.y/parser.cs file of my managed language sercice and understandebly I get an error on GetService. DTE dte =( ) 此 typeof ( )));
DTE dte = (DTE)this.GetService(typeof(DTE));
Array activeProjects =( )dte.ActiveSolutionProjects;
Array activeProjects = (Array)dte.ActiveSolutionProjects;
项目 activeProj =( )dte.ActiveDocument.ProjectItem.ContainingProject;
我的问题是Parser类无法使用Getservice,我想知道是否有任何方法可以访问DTE,或者是否有任何其他方法可以访问parser.cs/parser.y中的活动项目. /p>
Project activeProj = (Project)dte.ActiveDocument.ProjectItem.ContainingProject;
My problem is that Getservice is not availabe to the Parser class and I was wondering if there is any way to access DTE, or is there any other way to access the active project within the parser.cs/parser.y . Hi,
谢谢
Thanks 这篇关于我的语言服务的Parser.cs文件中的GetService DTE请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
感谢 推荐答案
DTE服务名称为SDTE,以下语句可能没问题.
The DTE service name is SDTE, The following statement may be OK.DTE dte = this.GetService(typeof(SDTE)) as DTE;
kaku
kaku