Visual Studio Add-in Exec 自动运行
大家好,我遇到了一个不确定的困境,因为我不确定 Visual Studio 外接程序是否完全有可能自动运行其代码。
我需要一个可以被动运行的加载项,例如 Visual Studios 的记录器。但是,到目前为止我所知道的 Exec 方法只能执行命令栏功能,但我需要在用户右键单击或选择一行文本时执行的代码。
如果我将代码放入“querystatus”中,我就能够制作一个自动记录器,但这会被认为是糟糕的编程,并且当我简单地选择一段文本时它不会记录。
有谁知道如何在 Visual Studios 中制作被动或自动运行的代码?
Hey guys, I have a dilemma that I am uncertain about, as I not sure if it's is exactly possible for a Visual Studio Add-in to run its code automatically.
I need an add-in that can run passively, like a logger for Visual Studios. However, the Exec method that I know so far can only execute commandbar functionality, but I need the code to execute when the user right-clicks, or select a line of text.
I was able to make an automatic logger if i put my code in the "querystatus", but that would be considered bad programming, and it does not log when I simply select a piece of text.
Does anyone know how to make a passive or automatic running code in Visual Studios?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我认为您可能需要将其实现为 VS 包,这是扩展 Visual Studio 的更强大的方式。我强烈建议您查看有关“集成架构”的 MSDN 文档,它将让您对 VS 可扩展性模型的工作原理及其使用的一些概念有一个很好的了解。
更具体地说,对于您的问题,听起来您想扩展 Visual Studio 编辑器。 MSDN 上有很多有关扩展编辑器的文档。
希望这有帮助!
Unfortunately I think you may need to implement this as a VS Package, which is a much more powerful way to extend Visual Studio. I'd highly recommend looking at the MSDN documentation regarding the "Integration Architecture", it will give you a good idea about the VS extensibility model works and some of the concepts that it uses.
More specifically to your problem, it sounds like you want to extend the Visual Studio editor. There's quite a bit of documentation about extending the editor on MSDN.
Hope this helps!