具有托管可扩展性框架的 Visual Studio 2010

发布于 2024-09-04 03:21:06 字数 254 浏览 4 评论 0原文

我一直在研究 MEF(托管可扩展性框架),但我不完全确定它是否是我需要的并且可以帮助我完成我需要做的事情。

有人可以提供 MEF 的易于理解的描述,提供良好的资源和教程(除了 MSDN),和/或知道它是否可以完成我在 Visual Studio 下尝试执行的任务?

我想做的任务是每当用户选择文本字符串时将文本字符串“记录”到文本文件中。我还需要此功能来被动地实时运行,而 Visual Studio 外接程序不支持此功能,因为它们的行为是“单击按钮即可工作”。

I've been looking into into MEF (Managed Extensibility Framework), but I am not entirely sure if it is something that I need and can help me accommplish what I need to do.

Can someone provide an easy to understand description of MEF, provides good resources and tutorials (aside from MSDN), and/or know if it can do the task I am trying to do under Visual Studio?

The task I am trying to do is to "log" a string of text to a text file whenever the user selects a string of text. I also need this functionality to run passively and real-time, which Visual Studio Add-in's do not support this functionality, as their behavior is "click the button to work".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

秋风の叶未落 2024-09-11 03:21:06

看起来像这里的文档

http://msdn .microsoft.com/en-us/library/dd885240(v=VS.100).aspx

可能是一个有用的起点。

It looks like the docs here

http://msdn.microsoft.com/en-us/library/dd885240(v=VS.100).aspx

may be one useful starting point.

番薯 2024-09-11 03:21:06

请参阅我对类似问题的回答< /a>.

答案是“是”,这是可能的/支持的。在示例/文档/演练中查找以下内容:

IWpfTextViewCreationLister - 用于检测何时创建编辑器实例。
ITextView.Selection - 选择对象
ITextSelection.SelectionChanged - 每当选择更改时引发(但不适用于跟踪插入符号的空选择)

See my response to a similar question.

The answer is "yes", this is possible/supported. Look for the following in samples/documentation/walkthroughs:

IWpfTextViewCreationLister - for detecting when editor instances are created.
ITextView.Selection - the selection object
ITextSelection.SelectionChanged - raised whenever the selection changes (though not for the empty-selection tracking the caret)

凉城凉梦凉人心 2024-09-11 03:21:06

我确信这在 .NET 中是可能的,而无需“接近金属”,可能是对“较低级别代码”的引用。如果与 MouseEvent 处理程序结合使用,.NET 方法 TextPattern.GetSelection Method 将帮助您完成任务。

I'm sure this is possible in .NET without going 'close to the metal', probably a reference to 'lower level code'. The .NET Method TextPattern.GetSelection Method will help you to accomplish your task if combined with a MouseEvent Handler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文