Tim Wagner Visual Studio Platform Dev Manager Microsoft Corporation TL32

Preview:

Citation preview

Microsoft Visual Studio: Customizing And Extending Your Development Environment

Tim WagnerVisual Studio Platform Dev ManagerMicrosoft Corporation

TL32

Extending Visual Studio Finding extensions on VS Gallery Using the SDK to create packages Creating branded, standalone apps

Visual Studio 10 Extensibility Customizing the start page Building “drop in” components with MEF Extending the VS 10 editor Managing extensions and downloads

Agenda

Extend Your Development Experience

Find Tools• Online Gallery• CodePlex• New Visual Studio 10

download manager

Customize Tools• Templates• Code Snippets• Macros• Start Page• Debugger visualizations

Build Tools• Add-ins• Packages• Designers• DSLs• Editor components

Find Extensions In The Gallery

Power Commands

demo

Create custom tool window

Content XAML viewer DTE actions

Use SDK sample browser to initiate

Visual Studio 10 changes WPF shell

Custom Package: Tool Window

Development Tools Extensibility High-level APIs for controlling Visual Studio:

Drive the UI Create and manage projects Open, edit, save files Invoke commands

Used by macros and addins, but useful for packages as well

Our tool window will hook up a WPF button to a DTE command

Aside: "DTE"

XAML Tool Window

demo

Visual Studio Shell

Deployment Options

VS Extension

• Empty IDE• Free

redistribution• Great foundation

for standalone tools

Steps To Build And Deploy

VS Extensions• Packages• Content• Help

Custom Shell (optional)• Branding• Customizations

Setup Program• PLKs & SLKs**• Optionally chain in

Shell runtime

How Does it Work?

What? How?Create stub EXE Comes with default project

Apply custom branding Replace icons and splash screen;add your own “Help About” box

Customize menus and commands Uncomment tags in <AppName>.vsct file

Customize package registration Change <AppName>.pkgundef fileCustomize tool window registration Change <AppName>.pkgundef file

Add your own packages Add projects into solution and change Shell Dependencies

Add your own template Add template into shared template location and run /setup

Create setup for your shell product Use “Setup” project

Join Us At The VS Extensibility Center

Resources

VSX Developer Centerhttp://msdn.com/vsx

VSX Forums on MSDNhttp://social.msdn.microsoft.com/forums/en-US/vsx/threads

VSX Team Bloghttp://blogs.msdn.com/vsxteam

Visual Studio Galleryhttp://visualstudiogallery.com/

What's new?

Extending Visual Studio Finding extensions on VS Gallery Using the SDK to create packages Creating branded, standalone apps

Visual Studio 10 Extensibility Offerings Customizing the start page Building “drop in” components with MEF Extending the VS 10 editor Managing extensions and downloads

Agenda

Customizing the New Start Page

Customizing The New Start Page

Custom Start Page (XAML)

demo

Coming Up: Components!

New managed extensibility mechanism designed from the ground up All managed – no COM artifacts Component and contract based Used for emerging Visual Studio architecture Appears first in the editor Characterized by ease of construction

and deployment… Self describing payloads, “xcopy” semantics DILU (drop-in, light up) deployment *Not* focused on hot deploy in first release

Component Model

I need "Foo"

I provide "Foo"

I need "Foo"

Part A

Part B Part C

MEF Example: Host and Contract

static void Main(string[] args) { var container = new CompositionContainer();  var consoleWriter = new ConsoleWriter();  container.AddPart(consoleWriter);  container.AddPart(new DateOutputFormatter());  container.Compose();  consoleWriter.Write("Hello MEF, my first MEF app");  Console.ReadLine();}

public interface IOutputFormatter { string Format(string message);}

MEF Example: Provide/Consume

[Export(typeof(IOutputFormatter))]public class DateOutputFormatter : IOutputFormatter { public string Format(string message) {  return string.Format("{0}: {1}", DateTime.Now, message);  }}

public class ConsoleWriter { [Import]  public IOutputFormatter Formatter { get; set; }   public void Write(string message) {   Console.WriteLine(Formatter.Format(message));  }}

Catalog Catalog

Catalogs Discover Parts

Container

MEF In The Visual Studio Editor

The new editor is built entirely from MEF components

Extending or modifying the editor amounts to providing your own components

Many extensibility points designed to capture common paradigms…

Allows Us To Go From This…

To This!

Classification: Rich Text Formatting

Rich reading experience Multiple fonts Font styles and effects Opacity Higher performance

Fewer coloring requests to language services

Composable 3rd party “mixins”

easily supported Per-line transforms

Adornments: Powerful Graphics

Any WPF visual Drawn on one of several

planes Two tracking modes

Associate with text Associate with screen

Animation and behavior

Margin And Scrollbar Control

Replace or customize existing margins and scrollbar

Define new margins All four sides

Support for spatial mapping

Intellisense And Smart Tags

Any 3rd party (not just language services) can: Contribute to Completion Override the presentation of Parameter Help or

Quick Info Add menu items to Smart Tags

Editor Components – Highlight Word

demo

Managing Your Extensions

What if you could discover and search for extensions within the IDE?

What if you could install, manage, and update extensions there as well?

What if we could make publishing IDE extensions (of all flavors) easy, fast, and fun?

Extension Manager

New “in situ” experience for extensions… Discover (via VS Gallery) Download/install/manage Update

Simplified packaging and deployment Same DILU semantics, but for both existing and

new extensibility mechanisms Xcopy deploy; no magic, no hidden state

Think unzip and a manifest in XML VS SDK will deliver simplified authoring and

“one step” publication story Used by Visual Studio and 3rd parties

Tools -> Extension Manager

[Dis]Able, Uninstall, Update

Extending Visual Studio Finding extensions on VS Gallery Using the SDK to create packages Creating branded, standalone apps

Visual Studio 10 Extensibility Customizing the start page Building “drop in” components with MEF Extending the VS 10 editor Managing extensions and downloads

Your turn! Download the 2008 SDK and try the 2010 CTP

Agenda

Microsoft Visual Studio: Customizing and Extending Your Development Environment

Q&A

Evals & Recordings

Please fill

out your

evaluation for

this session at:

This session will be available as a recording at:

www.microsoftpdc.com

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Recommended