- A rash of bloggers
-
Just lately there seems to be a veritable feast of new blog stuff about VSX (if you don't mind me switching metaphors). Some of these I stumbled across and some were pointed up to me by DuncanP.
Phew!
- Welcome Jean-Marc!
-
Somewhat belatedly, I wanted to welcome the latest addition to the Visual Studio eXtensibility team.
Jean-Marc Prieur has been a long-time contributor to our community and now he's joined the team. I'm sure he'll have a huge impact with his passion for extending all things Visual Studio.
Welcome on board Jean-Marc.
- CSLAFactory.net
-
Josef Eissing and Marcel Binot just dropped me a note to say that they'd released a CTP of their new DSL for working with Rocky Lhotka's popular CSLA application framework. Having played Killer Bunnies with Rocky one time, I thought I'd better give it a mention.
You can find more detail at http://www.cslafactory.net

- Struggling with your Command Tables? VSCT PowerToy is here
-
vsct files (and their predecessors, ctc files) can be tricky little beasts to get just right.
As Pablo notes, the VSCT PowerToy lets you browse through all the installed command tables to see what effect your package has had and also directly opens vsct and cto files.

You can also easily use Tools/Options to point to the experimental hive to see why things aren't working as you expect in your debug session.
- DSL on the Mersey
-
Paul Kinlan dropped me a line about a talk he's doing on DSL and T4 at the upcoming Liverpool .Net User Group.
Find more event details here.
- Come hang out at VS Live in San Francisco
-
Just a quick note that my colleague Anthony Cangialosi and I will be speaking about Visual Studio eXtensibility, DSL Tools, Visual Studio 2008 Shell and other similar goodness at VS Live in San Francisco on Monday. Hope to see some of you there or at the Visual Studio Extensibility booth.
Visual Studio Extensibility: How To Customize Visual Studio for Your Project
Monday, March 31, 10:15 a.m. to 11:30 a.m
- Tidbit for squeaking customization of DSL Add... menu items
-
I've answered this a couple of times internally, so I thought I'd better post it.
The Add... menus in DSL Designers are dynamically generated from the ElementMergeDirective data you supply as part of your model.
For example, if you say that a domain class Door can be merged in to a domain class House then we'll dynamically generate an Add menu entry for Doors on Houses in the model explorer and on any compartment shape representation of House and Door.
This is handy, but our customization story here isn't too hot as the only way you can get in and modify this is by finding the "Add" menu, zapping it completely and putting your own entries in there instead. This is pretty heavy handed as you'll also have zapped the menu for "Add Chimney" and "Add RoseGarden" at the same time. See Duncan's post here for how to accomplish this.
A sneaky way around this limitation is to take advantage of the fact that we call the CanMerge method on the parent as part of deciding whether to show individual menu items.
As it happens, we pass slightly odd parameters to this method when we're calling it purely for the purposes of deciding whether to show a menu.
The signature for CanMerge looks like this (on the House class in our example)
protected override bool CanMerge(DslModeling::ProtoElementBase rootElement,
DslModeling::ElementGroupPrototype elementGroupPrototype)
When you're pasting or dragging prototypes from toolbox, the parameters contain "real" ProtoElements with real Ids.
However, when you're testing the hypothetical ability to paste some not-yet-created future item from an add menu, the parameters contain "fake" ProtoElements with zero Ids.
So if rootElement.ElementId is Guid.Zero then you know you're in a hypothetical test.
The menu building tests for both compartment and explorer are hypothetical , so if you return false on Guid.Zero, then the offending menu item should simply disappear from both places.
Not exactly blindingly obvious, but it's gotten a couple of teams out of a hole.
Technorati Tags:
DSLTools,
VSX,
Tips
- Is your job so bad?
-
From Jim Glass...
A CRM Riff : 5 Reasons to Quit Complaining About Your Job
The first one gives me vertigo just sitting here.
Technorati Tags:
Job Humor
- Visual Studio Gallery is Live
-
Soma has just announced that our new Gallery for all kinds of VS eXtensions is live.
Major props to Anthony Cangialosi, as he's been been the driving force behind making this happen.
You can find Anthony discussing the Gallery with Ken Levy on video at channel 9 here.
- New DSL Tools Videos Online
-
I've just noticed that at the top of the Visual Studio Start Page RSS feed today are two groovy videos on DSL Tools - one on basics and one on more advanced customizations. And a really fun domain chosen - modeling the solar system!
How Do I: Create and Customize My Domain Specific Language?
In this video, Dylan Miles, shows you how to create and customize your own Domain Specific Language using Visual Studio DSL Tools. He shows you the basics of creating your own domain classes, changing the visual properties of shapes as well as adding your own custom properties.
Presented by Dylan Miles http://www.alchemysoftware.co.za on February 19, 2008
Length: 22 minutes 10 seconds
How Do I: Use Advanced Customization?
Learn how to override functionality in the generated code of your Domain Specific Language. Dylan Miles explains how using a custom constructor, custom storage for your shape and domain classes as well as hooking events to your shape classes.
Presented by Dylan Miles http://www.alchemysoftware.co.za on February 12, 2008
Length:26 minutes 8 seconds
Enjoy.
- XNA Studio and DSL Tools - Better Together
-
I've been meaning to blog this for an age.
Over in Furtaspace (love that name), André points out that with the (relatively) recent release of XNA Studio 2.0, you can now use teh 2005 version of VDSL Tools to create model-driven game creation tooling.
As Andre says, "Sweet!"
And in somewhat more stop press news, turns out that André has joined Microsoft - welcome on board André. (Now why on earth didn't you come interview for the jobs on our team?)
Technorati Tags:
VSX,
XNA,
DSL Tools
- Web Service Software Factory Modeling Edition Customization via Avanade
-
Gerardo de Geest and Gerben van Loon of Avanade have a great new MSDN article...
Web Service Software Factory: Modeling Edition, also known as the Service Factory, is a collection of resources to help you model and build Web services for Windows® Communication Foundation (WCF) and ASMX in an easy and efficient way. The main difference from previous versions of the Service Factory is that this latest edition uses models whereas the previous release was based on wizards by way of the Guidance Automation Toolkit (GAT). The Service Factory now allows you to build a Web service by creating three different models: the data contract model, the service contract model, and the host model. We will first discuss these three models, and then we will show you how to customize the Service Factory. You can find additional information at the Web sites listed in the "Online Service Factory Resources" sidebar.
- Underexplored VSX Nuggets Vol #37: How a DSL Diagram is rendered
-
This is an area I always have to remind myself of every time someone asks a question, so I thought I'd better write it up. Essentially there are four layers involved:
Starting in the middle and working outwards, the classes' responsibilities are as follows:
Diagram - This is the logical representation of you diagram's data. It is a generated class in your DSL project, created from the Diagram element in your DSL model. Consequently, it is a Store-based class and its data is therefore subject to the Store's transactional model. It acts as the root of the ShapeElement-derived object tree (the nodes and links) that provides the persistent store of your DSL's presentation model. This chiefly consists of the positions of shapes, their attachments to each other via links and nesting, expanded/collapsed state etc. You can look at the contents of your DSLs .diagram file to see the kind of data that is stored in this object tree.
The key responsibilities of the Diagram class are to manage the View Fixup process that creates ShapeElements to match domain model elements and to hold the mapping data for that process. Keeping the mapping data on the Diagram and out of individual shapes potentially allows shapes to be reused across different diagram types. Diagrams know very little about the rendering process.
DiagramClientView - This is the WinForms Control-derived class that actually renders the content of the Diagram object. It responds to mouse events, keyboard events and manages the math for the current zoom level and viewport bounds. It handles the tooltip and selected items list and supports drag/drop. It's a purely vanilla control and doesn't know that it is hosted inside Visual Studio. Its name comes from the fact that in Win32 terms it is managing the client area of the diagram surface.
DiagramView - This is the outermost layer of the control rendering stack. It's a WinForms Control that has the responsibility of providing the realization of the viewport data stored in its child, the DiagramClientView. Our implementation chooses to do this by using a couple of scroll bars. In theory, a different viewport manager could be added that used something else like a panning tool or some cool dynamic fisheye view. In practice we've never tried replacing this so it may or may not be practical.
The DiagramView also provides the Watermarking facility and expects to be sited (IObjectWithSite) in order to have access to a toolbox service.
This class is specialized as a VSDiagramView in order to hook the VS undo stack to the individual Diagram being rendered and to connect the Diagram's notion of selected items to VS's selection system.
DiagramDocView - This is part of the DSL Tools' implementation of the Doc/View pattern that Visual Studio imposes. It is generated in your DslPackage project and provides the bridge from the largely VS-agnostic diagram rendering into VS's world. In VS, a DocView's key responsibility is to provide the content that renders its underlying DocData object (which represents the content of the file or other store being edited). In this case, the immediate base class, DiagramDocView satisfies that by creating the VS-specific VSDiagramView control and connecting it to a Diagram instance in its override of the LoadView method. It also hooks the VS help system to the Diagram and its content.
If you need to use a custom VSDiagramView-derived class, you should override CreateDiagramView and don't forget to include the following (slightly unfortunate) code to set up the DiagramView:
public override VSDiagramView CreateDiagramView()
{
// Add a single designer to our collection
SomeDerivedVSDiagramView designer = new SomeDerivedVSDiagramView ();
designer.BackColor = System.Drawing.SystemColors.Window;
designer.Dock = System.Windows.Forms.DockStyle.Fill;
designer.DocView = this;
designer.MouseUpEvent += DesignerMouseUpEvent;
designer.DiagramClientView.ZoomChanged += DesignerZoomChanged;
designer.DiagramClientView.TakeFocusOnDragOver = true;
designer.Site = new VSDiagramViewSite(this);
return designer;
}
- More general-purpose T4 goodness
-
Oleg saw my post about Kiril's general-purpose use of T4 and gently pointed me at the set of resources he has put up in the same area.
It's really great to see folks exploiting the richness we've added by putting T4 into every copy of Visual Studio 2008.
Interestingly, Oleg points up the nVelocity project, a port of the Jakarta Velocity project to .Net as well as long-time player in this space on our platform, CodeSmith.
It's good to have a range of options for this kind of stuff.
- Inovak learns VSX - Now!
-
Over in Hungary, one of our C# MVPs, Inovak has started a extremely nice series of mini-articles on getting started with VSX that he calls LearnVSXNow!
I'll be fascinated to watch this develop.