Extending Visual Studio 2003 - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Extending Visual Studio 2003

Description:

Paul Sturgill - Building a Visual Studio Add-in. Agenda. How can we extend VS 2003? ... www.microsoft.com/downloads/details.aspx?FamilyId=EE1C9710-6DF7-4F3F-A5AE ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 18
Provided by: paulst94
Category:

less

Transcript and Presenter's Notes

Title: Extending Visual Studio 2003


1
Extending Visual Studio 2003
  • Building a VS Add-in

Visual Basic Pro User Group May 6, 2004
2
Who Am I?
  • Paul Sturgill
  • Psturgill_at_Commonwealth.com
  • Commonwealth Financial Network
  • Language of choice VB.NET

3
Agenda
  • How can we extend VS 2003?
  • Automation Object Model
  • What makes VS 2003 extensible?
  • Demos
  • Extensibility future VS 2005 features
  • Creating your own extensible application

4
Introduction
  • How can we extend Visual Studio 2003?
  • What are our options?
  • VS Add-in is a COM component
  • DTE is a COM wrapper

5
(No Transcript)
6
What makes VS extensible?
  • Interfaces!!

7
Interfaces
  • Extensibility.IDTExtensibility2
  • OnAddInsUpdate List of add-ins change
  • OnBeginShutdown IDE shuts down
  • OnStartupComplete IDE startup complete
  • OnDisconnection Add-in unloads from IDE
  • OnConnection Add-in is loaded into IDE
  • IDTCommandTarget
  • Exec invokes Add-in behavior (menu item)
  • QueryStatus listing available add-ins

8
NEVB Demo Add-in
  • Features
  • Code manipulation
  • IDE Event tracking
  • Launched Window application
  • Tool Window

9
Start Demos
10
Visual Studio 2005 (Whidbey)
  • Main goal is less COM
  • No more Regsvr32
  • Use XML file to define an Addin
  • No more shim control for Toolwindow
  • New CreateToolWindow2 method
  • Toolbar accepts different types of controls
  • Combo box, checkbox, etc not just buttons

11
3 Steps to creating Pluggable Software
Define Common Interface
Implement Interface
Create hosting application
12
Define Custom Interface
  • Public Interface ICustomAddin
  • Function Start() as Boolean
  • Function Stop() as Boolean
  • End Interface

Equivalent to IDTExtensibility2 Interface
13
Implementation of Interface
  • Public Class MyCustomAddin
  • Implements ICustomAddin
  • Public Function Start() as Boolean Implements
    ICustomAddin.Start
  • Do something here when the add-in starts
  • End Function
  • Public Function Stop() as Boolean Implements
    ICustomAddin.Stop
  • Do something here when the add-in stops
  • End Function
  • End Class

Equivalent to custom VS Add-in
14
Hosting Application
  • Dim assem As Reflection.Assembly
    Reflection.Assembly.LoadFrom(c\plugins\mycustomp
    lugin.dll)
  • Dim oAddin As Object
  • Dim iAddin As PluginLibrary.iCustomAddin
  • oAddin assem.CreateInstance(MyCustomAddin.MyCus
    tomAddin)
  • iAddin CType(oAddin, PluginLibrary.ICustomAddin)
  • iAddin.Start()

Equivalent to Visual Studio as a hosting
application
15
Summary
  • VS Extensibility
  • Macros
  • Add-ins
  • VSIP Visual Studio Industry Partner
  • Visual Studio 2005 enhancements
  • Add-in contest runs to 5/31/2004
  • http//weblogs.asp.net/rosherove/

16
Where to Get More Information
  • Microsoft VSIP Program
  • http//msdn.microsoft.com/vstudio/extend/
  • Writing Add-Ins for Visual Studio .NET
  • Les Smith (Apress)
  • Yahoo User Group
  • http//groups.yahoo.com/group/vsnetaddin/
  • Microsoft Sample Downloads
  • http//www.microsoft.com/downloads/details.aspx?Fa
    milyIdEE1C9710-6DF7-4F3F-A5AE-425A478DDEEBdispla
    ylangen

17
Feedback
  • Please send feedback to Psturgill_at_Commonwealth.com
Write a Comment
User Comments (0)
About PowerShow.com