Visual Studio 2010 with Managed Extensiblity Framework

ε祈祈猫儿з 提交于 2019-12-08 08:18:07

问题


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".


回答1:


It looks like the docs here

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

may be one useful starting point.




回答2:


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)




回答3:


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.



来源:https://stackoverflow.com/questions/2977272/visual-studio-2010-with-managed-extensiblity-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!