630 likes | 959 Views
VSX: Extend Your Development Experience. James K. Lau jameslau@microsoft.com Lead Program Manager, VS Ecosystem. Jean-Marc Prieur jmprieur@microsoft.com Program Manager, VS Ecosystem. Objectives. Why you should care about VSX?. What is VSX?. How can you take advantage of VSX?.
E N D
VSX: Extend Your Development Experience James K. Lau jameslau@microsoft.com Lead Program Manager, VS Ecosystem Jean-Marc Prieur jmprieur@microsoft.com Program Manager, VS Ecosystem
Objectives Why you should care about VSX? What is VSX? How can you take advantage of VSX?
Visual Studio Custom Environment (i.e. Hardware controller programming) Modeling (e.g. UML editor) Productivity (e.g. Windows Manager) Controls (e.g. Custom DataGrid) Coding (e.g. Refactoring tool) Data (e.g. Oracle database tool) Build (e.g. Distributed build) Programming Languages (e.g. COBOL) Analysis (e.g. Code scanner) Team Development (e.g. SVN plug-in)
Visual Studio Gallery • One-stop location for Visual Studio extensions. • Hundreds of extensions available from Microsoft and 3rd parties, both free and paid. • Anyone can publish their extensions onto VS Gallery.
Using Source Outliner Leveraging on VSX by using Visual Studio extensions http://www.visualstudiogallery.com
Why Build Extensions? Customize VS to your environment Apply policies across teams Avoid repetitive work Faster and higher quality development Business Opportunity
Visual Studio Extensibility Map Brace matching IntelliSense Colorization Project Location Code snippets • Feature Customizations Integration to Object browser And Class View • Data Designer Extensibility providers • Splash Screen Code Editor Language Services SandCastle Extension F1 Integration CodeModel • Shell customization Multi View Editor Validation Help documentation Document Editors Dynamic help Integration Text document • Application Id Coherence • Help • Integration Project Properties pages GraphicalModellingDesigner Custom Test type Project Type T4 Technology Team Test Project Template Code Generator Custom Host Adapters Single file Generator Project model Item Template • IDE • Extensibility Team System Extensibility Custom Wizards Solution Template • Source control • Client Provider Source control Tracking External Tools TFS Reporting Componentmodel • Team Foundation Server VSCT Menus/Commands Properties Windows User Interface VS Commands Process Templates Work Item Tracking • Debugger Output Window Error List Team Build Toolbox Debug Engines Expression Evaluator Help About Box Debugger Visualizers Tool Windows Task List Options Pages Status
Graphical designers Common Visual Studio Objects Text Documents (in tabs here) Tool Windows (in tabs here) Toolbox items in compartments
Visual Studio ObjectsMenus & Commands Menu Toolbar Button / Icon Group Buttons and icons are associated with invisible objects: a command
Visual Studio Objects(no user interface) • There are objects we do not see (because they are internal) • Commands (presented by buttons/icons) • Packages • Hint might be given by their registration information (Splash / About) • Providing Services, Projects types, Editors, Views, Code Generators, etc … • Different technologies are available to manipulate those objects and to add new objects.
Extending Visual Studio (Another Perspective) Diagrams Customize Extend Languages Add-ins Macros Customization Visual Studio
Technologies and toolsto customize and extend Visual Studio Graphical Designers Extend with the VS SDK DSL Tools Customize Extend Managed Package Native code package Package wizardVS SDK Assist Babel MLEX/MPPG Managed Package Framework Add-ins Macros Automation API Customization Visual Studio(core + COM interfaces) SandCastle wix
Window Types Document Window Tool Window
Services Packages proffer their services to the Core, which allows other packages to access them IVsProvided Visual Studio provides many services Packages can also provide services SVsProvided Outliner Lite Package C# Package IVsSolution3 IVsSolution2 IVsOutputWindow IVsSolution Visual Studio Core SVsOutputWindow SVsSolution
Where are we? Basic IDE extensibility Brace matching IntelliSense Colorization Project Location Code snippets • Feature Customizations Integration to Object browser And Class View • Data Designer Extensibility providers • Splash Screen Code Editor Language Services SandCastle Extension F1 Integration CodeModel • Shell customization Multi View Editor Validation Help documentation Document Editors Dynamic help Integration Text document • Application Id Coherence • Help • Integration Project Properties pages GraphicalModellingDesigner Custom Test type Project Type T4 Technology Team Test Project Template Code Generator Custom Host Adapters Single file Generator Project model Item Template • IDE • Extensibility Team System Extensibility Custom Wizards Solution Template • Source control • Client Provider Source control Tracking External Tools TFS Reporting Componentmodel • Team Foundation Server VSCT Menus/Commands Properties Windows User Interface VS Commands Process Templates Work Item Tracking • Debugger Output Window Error List Team Build Toolbox Debug Engines Expression Evaluator Help About Box Debugger Visualizers Tool Windows Task List Options Pages Status
A precision about Menus and Commands <?xmlversion="1.0"encoding="utf-8"?> <CommandTablexmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable"xmlns:xs="http://www.w3.org/2001/XMLSchema"> <Externhref="stdidcmd.h"/> <!--commands exposed by VisualStudio. --> <Externhref="vsshlids.h"/> <!--Command ids for the menus provided by the shell. --> <Externhref="msobtnid.h"/> <!--Definition of some VSCT specific constants --> <Commandspackage="guidSourceOutlinerLitePkg"> <Groups/> <Buttons> <Buttonguid="guidSourceOutlinerLiteCmdSet"id="cmdidSourceOutlinerLite"priority="0x0100"type="Button"> <Parentguid="guidSHLMainMenu"id="IDG_VS_WNDO_OTRWNDWS1"/> <Iconguid="guidImages"id="bmpPicSearch" /> <Strings> <CommandName>cmdidSourceOutlinerLite</CommandName> <ButtonText>Source Outliner</ButtonText> </Strings> </Button> </Buttons> <!--The bitmaps section is used to define the bitmaps that are used for the commands.--> <Bitmaps> <Bitmapguid="guidImages"href="Resources\Images_32bit.bmp"usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/> </Bitmaps> </Commands> <Symbols> <!-- This is the package guid. --> <GuidSymbolname="guidSourceOutlinerLitePkg"value="{1d3cffcc-a3a1-4a6d-873b-e0766357b056}" /> <!-- This is the guid used to group the menu commands together --> <GuidSymbolname="guidSourceOutlinerLiteCmdSet"value="{64966bb1-cb92-44bd-8d41-f2026708d74a}"> <IDSymbolname="MyMenuGroup"value="0x1020" /> <IDSymbolname="cmdidSourceOutlinerLite"value="0x0101" /> </GuidSymbol> <GuidSymbolname="guidImages"value="{aabbe906-8d4b-472e-a0a9-add8334f6f30}" > <IDSymbolname="bmpPic1"value="1" /> <IDSymbolname="bmpPic2"value="2" /> <IDSymbolname="bmpPicSearch"value="3" /> <IDSymbolname="bmpPicX"value="4" /> <IDSymbolname="bmpPicArrows"value="5" /> </GuidSymbol> </Symbols> </CommandTable> Statically defined in VSCT (2008+) or CTC (2005-) VSCTPowerToy.exe Helps a lot
Graphical Model Designers Creating Graphical Designers with the DSL Tools
Where are we? Graphical Modeling Languages Brace matching IntelliSense Colorization Project Location Code snippets • Feature Customizations Integration to Object browser And Class View • Data Designer Extensibility providers • Splash Screen Code Editor Language Services SandCastle Extension F1 Integration CodeModel • Shell customization Multi View Editor Validation Help documentation Document Editors Dynamic help Integration Text document • Application Id Coherence • Help • Integration Project Properties pages GraphicalModellingDesigner Custom Test type Project Type T4 Technology Team Test Project Template Code Generator Custom Host Adapters Single file Generator Project model Item Template • IDE • Extensibility Team System Extensibility Custom Wizards Solution Template • Source control • Client Provider Source control Tracking External Tools TFS Reporting Componentmodel • Team Foundation Server VSCT Menus/Commands Properties Windows User Interface VS Commands Process Templates Work Item Tracking • Debugger Output Window Error List Team Build Toolbox Debug Engines Expression Evaluator Help About Box Debugger Visualizers Tool Windows Task List Options Pages Status
Graphical Languages & Designers • You know theclass diagram • Sometimes a picture is worththousand words • ... But we need a formal picture enabling generating code, config files, documentation ... public partial class LineTool { … protectedoverrideShape CreateElement() { return new Line(); } protected internal override void OnMouseLeftButtonDown(Point point, Shape hit) { X1 = point; X2 = point; } protected internal override void OnMouseLeftButtonUp(Point point, Shape hit) { X2 = point; Terminate(); } protected internal override void OnMouseDrag(Point point, Shape hit) { X2 = point; } } }
Adding our own languages ... • ... With the DSL Tools, we can • Add a new element of type « .mymodel » to a Visual Studio Visual Studio. • Draw some model, change its properties, and automatically generate correct source code from it? • Advantages • Faster, less error prone, better code quality and maintainability • Makes it possible for user domain who are not development experts • We can have a tight integration in IDE(the DSL potentially knows all the solution, and acts on it)
Process of creating DSL : using the DSLTools DSL Author (uses DSL Tools to create DSLs) Uses the Product Uses DSL to createproduct creates Package VS 2008 DSL for Specific domain generates Framework VS 2008 SDK Code, Doc config files DSL Tools builds Framework Final Product FW Visual Studio 2008
DSL Tools demo Creating a simple graphical designer Generating C# code for inheritance
vsCustomization What is Generated Custom code Custom code for commands, designer customization … T4 Templates Coherence and validation rules Modeling Validation Diagram ShapesConnector Classes, Relationships, enums, validation of multiplicity, properties, Serialisation Directive processor Toolbox, context menu, Model Explorer, Doc, View, Package Maps Modeling Diagram Shell Modeling Text Templating
Team Foundation Server Extensibility Brace matching IntelliSense Colorization Project Location Code snippets • Feature Customizations Integration to Object browser And Class View • Data Designer Extensibility providers • Splash Screen Code Editor Language Services SandCastle Extension F1 Integration CodeModel • Shell customization Multi View Editor Validation Help documentation Document Editors Dynamic help Integration Text document • Application Id Coherence • Help • Integration Project Properties pages GraphicalModellingDesigner Custom Test type Project Type T4 Technology Team Test Project Template Code Generator Custom Host Adapters Single file Generator Project model Item Template • IDE • Extensibility Team System Extensibility Custom Wizards Solution Template • Source control • Client Provider Source control Tracking External Tools TFS Reporting Componentmodel • Team Foundation Server VSCT Menus/Commands Properties Windows User Interface VS Commands Process Templates Work Item Tracking • Debugger Output Window Error List Team Build Toolbox Debug Engines Expression Evaluator Help About Box Debugger Visualizers Tool Windows Task List Options Pages Status
Team Foundation Server • Microsoft’s premier team development server: • Source control • Work Item tracking • Build monitoring • All-in-one server. • Exposes APIs that can be accessed programmatically; not only in Visual Studio.
Reference Assemblies // Team server TeamFoundationServertfs = null; • VersionControlServerversionControl; • TeamProjectproject; // Get the server fromitsname. • ICredentialsProvidercredentialProvider = new UICredentialsProvider(); • tfs = • TeamFoundationServerFactory.GetServer(teamFondationServerName, • credentialProvider); • // Get the Version control server. • if (tfs != null) • { • tfs.EnsureAuthenticated(); • versionControl =tfs.GetService(typeof(VersionControlServer)) • as VersionControlServer; • } • if (!string.IsNullOrEmpty(projectName)) • project= versionControl.TryGetTeamProject(projectName);
TFS Extensibility A change log using the TFS assemblies
Trying to model (Version control) foreach (ChangesetchangeSetin versionControl.QueryHistory("$/"+projectName// Path , VersionSpec.Latest// Version spec , 0 // DeletionId , RecursionType.Full// Recursion , ""// User , null// from , VersionSpec.Latest// to , int.MaxValue// maxitems , false// Include changes , true) // Slotmode ) if (changeSet.CreationDate >= since) foreach (WorkItemworkIteminchangeSet.WorkItems) if (workItem.Project.Name == project.Name) …
TFS ExtensibilitySummary Advantages • Simple to use Disadvantages • Difficult to draw a model… • No strongly typed relationships between classes • Everything is obtained by method call • Requires reading through documentation for initial learning
Team Foundation Server Extensibility Brace matching IntelliSense Colorization Project Location Code snippets • Feature Customizations Integration to Object browser And Class View • Data Designer Extensibility providers • Splash Screen Code Editor Language Services SandCastle Extension F1 Integration CodeModel • Shell customization Multi View Editor Validation Help documentation Document Editors Dynamic help Integration Text document • Application Id Coherence • Help • Integration Project Properties pages GraphicalModellingDesigner Custom Test type Project Type T4 Technology Team Test Project Template Code Generator Custom Host Adapters Single file Generator Project model Item Template • IDE • Extensibility Team System Extensibility Custom Wizards Solution Template • Source control • Client Provider Source control Tracking External Tools TFS Reporting Componentmodel • Team Foundation Server VSCT Menus/Commands Properties Windows User Interface VS Commands Process Templates Work Item Tracking • Debugger Output Window Error List Team Build Toolbox Debug Engines Expression Evaluator Help About Box Debugger Visualizers Tool Windows Task List Options Pages Status
Introducing: Visual Studio 2008 Shell • Empty “Shell” with IDE features. • No Visual Studio as a pre-requisite. • Accelerates development.
Visual Studio Shell Features More details here
Integrated vs. Isolated Modes VS Shell (isolated) Runtime VS Shell (isolated) Runtime
Storyboard Designer A Specialized Tool Built on Visual Studio 2008 Shell (isolated mode)
VS Ecosystem Growth • Averaging 30% year-over-year partnership and product growth since VSIP program inception. • Currently over 200 Alliance/Premier VSIP partners have released ~1200 products. • Over 10,000 public products integrated into Visual Studio across all levels of extensibility.
Resources http://msdn.com/vsx