如何找到属于itextView的文档的文件名?
我目前正在编写视觉工作室扩展名,并已实现函数 textViewCreated
在实现itextViewCreationListener
接口的类中。
使用itextView
参数来调用该函数,该参数表示刚刚创建的编辑器窗口的内容。但是,我不仅需要对已编辑的文档的竞争,还需要其代表的文件的路径,而itextView
对象显然没有获得该信息的方法。
到目前为止,我已经使用了dte2.ActivedOcument
属性,但它并不总是正常工作。尤其是如果一个人在Visual Studio中打开一个新的文本窗口,而另一个已经打开了一个窗口,则activedocument
是指上一个文档。
一个人可以做什么来纠正这一点?
I am currently writing a Visual Studio extension and have implemented the function TextViewCreated
in a class that implements an ITextViewCreationListener
interface.
The function is called with an ITextView
parameter that represent the content of the editor window that just has been created. However, I need not just the contend of the edited document but also the path the file it represents, and an ITextView
object apparently has no method to get that information.
So far, I have used the DTE2.ActiveDocument
property, but it does not always work correctly. Especially if one opens a new text window in Visual Studio while another one is already open, ActiveDocument
refers to the previous document.
What can one do to correct this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)