none
Feature Builder : Modeling Launch Point and Command : context RRS feed

  • Question

  • Hello,

    I successfully create an extension attached to a class diagram (on package elements). Now I want to get the name of the element on which the user clicked (here the package). I don''t see any context information on the command interface or in the ValueProvider base class to be able to retrieve the information. 

    Any documentation exist for Feature Builder ?

    Matthieu

     

    Friday, May 21, 2010 6:05 PM

Answers

  • Hi Matthieu,

    Feature Builder is using MEF to get access to serveral Visual Studio services and/or other useful information. You can add the code below to your custom command  to get to the diagram context.

     [Import]
     public IDiagramContext diagramContext { get; set; }
    
    
    

    After that, in your Execute method you can, for example, use code like "diagramContext.CurrentDiagram.SelectedShapes" to get access to the selected shape(s).

    Hope this helps!

    Edward

    Friday, May 21, 2010 7:42 PM

All replies