如何使用MEF为VS2010编写插件? [英] How can I write a plugin for VS2010 using MEF?

查看:90
本文介绍了如何使用MEF为VS2010编写插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到很多用于插入自定义应用程序的MEF代码,但是我还没有找到如何使用MEF为VS2010编写插件的方法.我的印象是新的IDE支持此功能.

I've seen lots of MEF code for plugging into custom apps, but I am yet to find out how to write a plugin for VS2010 using MEF. I was under the impression that the new IDE supported this.

有人知道开箱即用"是否支持此功能,或者是否需要安装.有没有人有任何链接,提示等帮助我入门.

Does anyone know if this is supported 'out of the box', or does it require an install. Does anyone have any links, tips, etc to get me started.

推荐答案

MEF是扩展编辑器的主要扩展机制.如果您安装SDK ,在C# (or VB)->Extensibility下找到了一些用于创建编辑器扩展的新项目示例.这些包括:

MEF is the primary extension mechanism for extending the editor. If you install the SDK, there are a few new project samples set up to create editor extensions, found under C# (or VB)->Extensibility. These include:

  • 编辑器分类器–用于提供语法突出显示
  • 编辑器边距–在编辑器的两侧放置空白,带有任意WPF内容
  • 编辑器文本/视口装饰–将WPF视觉效果放入编辑器中

您可以在MSDN上找到概述文档:扩展编辑器 ,以及编辑器扩展点.

You can find overview documentation on MSDN: Extending the editor, and Editor extension points.

您可能需要查看一些示例: code.msdn.microsoft.com上的编辑器示例,有关 editorsamples.codeplex.com 的更多信息,以及我写的所有示例.

Some samples you may want to look at: editor samples on code.msdn.microsoft.com, a couple more on editorsamples.codeplex.com, and the source for all the samples I've written.

关于编写编辑器扩展的博客.在这里,您可以找到我编写的大多数扩展的说明,以及有关性能,新编辑器设计等的更一般的帖子.

I blog about writing editor extensions. On there, you can find descriptions of most of the extensions I've written, along with more general posts about performance, design of the new editor, etc.

在msdn上的编辑器论坛上发布的问题由编辑团队的各个成员回答.

Questions posted on the editor forum on msdn also are answered by various members of the editor team.

这篇关于如何使用MEF为VS2010编写插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆