具有托管可扩展性框架的 Visual Studio 2010
我一直在研究 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来像这里的文档
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.
请参阅我对类似问题的回答< /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 objectITextSelection.SelectionChanged
- raised whenever the selection changes (though not for the empty-selection tracking the caret)我确信这在 .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.