O'Reilly logo

Microsoft® Visual Studio® 2010 Unleashed by Lars Powers, Mike Snell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Your Own MEF-Based Editor Extension

We have now covered all of the ingredients necessary to build your own extension. Let’s walk through a simple example, end to end, and build an extension that displays some basic code metrics in a window in the corner of the editor. Functionally, we need to accomplish the following:

• Compute the required code stats by parsing the currently loaded code file

• Expose a set of properties on a WPF user control to hold those metrics; this user control also displays those metrics

• Display the WPF user control as an editor viewport adornment

Because this involves creating a new adornment pegged to the editor’s viewport, we have the luxury of starting with the code produced for us by the Viewport Adornment ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required