views:

234

answers:

1

Is it possible to enable users to drag and drop a Table from the Visual Studio Server Explorer onto my own DSL Diagram?

I can drop custom Domain Classes I have created but want to make use of the build in funcationality.

I am working in Visual Studio 2010.

A: 

I suppose you could override the CreateDiagramView method in your DocView class, and call CreateDiagramView to get to the diagram. From there, you could listen to the DragDrop event. If you can understand what was dropped on you, you could do something with it.

Note: I haven't tested any of this - just happened to have a DSL open and played a bit.

John Saunders
It is something to go on... I will update the results here. Thanks for your time
Phill Duffy
I tried it briefly, didn't work. Tried attaching the events to the Control returned from the base.Windows property - hasn't worked yet.
John Saunders
I have created a partial class with the diagram class and overridden the drag drop, I am getting there but not all the way - ActiveWriter is a fantastic open source example of it in action - I am trying to learn from it
Phill Duffy
Thanks. Hadn't heard of that one. Try NORMA (http://www.ormfoundation.org/files/folders/norma_the_software/default.aspx) also. Sources are up on SourceForge. Very, very sophisticated use of DSL Toolkit. And to really blow your mind about the toolkit, see http://www.codeplex.com/servicefactory/, which is able to tie three separate DSLs together.
John Saunders