Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
481 views
in Technique[技术] by (71.8m points)

visual studio 2010 - How can I write a plugin for VS2010 using MEF?

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

  • Editor classifier – for providing syntax highlighting
  • Editor margin – putting a margin along the sides of the editor, with arbitrary WPF content
  • Editor text/viewport adornment – for putting WPF visuals into the editor

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

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...