开发者

Visual Studio 2010 with Managed Extensiblity Framework

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 g开发者_高级运维ood 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".


It looks like the docs here

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

may be one useful starting point.


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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜