1 / 17

Extending Visual Studio 2003

Extending Visual Studio 2003. Building a VS Add-in. Visual Basic Pro User Group May 6, 2004. Who Am I?. Paul Sturgill Psturgill@Commonwealth.com Commonwealth Financial Network Language of choice: VB.NET . Agenda. How can we extend VS 2003? Automation Object Model

yamin
Download Presentation

Extending Visual Studio 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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@Commonwealth.com • Commonwealth Financial Network • Language of choice: VB.NET Paul Sturgill - Building a Visual Studio Add-in

  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 Paul Sturgill - Building a Visual Studio Add-in

  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 Paul Sturgill - Building a Visual Studio Add-in

  5. Paul Sturgill - Building a Visual Studio Add-in

  6. What makes VS extensible? Interfaces!! Paul Sturgill - Building a Visual Studio Add-in

  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 Paul Sturgill - Building a Visual Studio Add-in

  8. NEVB Demo Add-in • Features: • Code manipulation • IDE Event tracking • Launched Window application • Tool Window Paul Sturgill - Building a Visual Studio Add-in

  9. Start Demos Paul Sturgill - Building a Visual Studio Add-in

  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 Paul Sturgill - Building a Visual Studio Add-in

  11. 3 Steps to creating Pluggable Software Define Common Interface Implement Interface Create hosting application Paul Sturgill - Building a Visual Studio Add-in

  12. Define Custom Interface Public Interface ICustomAddin Function Start() as Boolean Function Stop() as Boolean End Interface *Equivalent to IDTExtensibility2 Interface Paul Sturgill - Building a Visual Studio Add-in

  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 Paul Sturgill - Building a Visual Studio Add-in

  14. Hosting Application Dim assem As Reflection.Assembly = Reflection.Assembly.LoadFrom(“c:\plugins\mycustomplugin.dll”) Dim oAddin As Object Dim iAddin As PluginLibrary.iCustomAddin oAddin = assem.CreateInstance(“MyCustomAddin.MyCustomAddin”) iAddin = CType(oAddin, PluginLibrary.ICustomAddin) iAddin.Start() * Equivalent to Visual Studio as a hosting application Paul Sturgill - Building a Visual Studio Add-in

  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/ Paul Sturgill - Building a Visual Studio Add-in

  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?FamilyId=EE1C9710-6DF7-4F3F-A5AE-425A478DDEEB&displaylang=en Paul Sturgill - Building a Visual Studio Add-in

  17. Feedback • Please send feedback to Psturgill@Commonwealth.com Paul Sturgill - Building a Visual Studio Add-in

More Related