src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/Diagram/DSLDesignerNavigationHelper.cs
/// <summary>
///     This method will return a DSL ShapeElement for the given efobject.  If the given efobject doesn't map to a designer shape,
///     then this will look for a designer shape for the object's parent.
///     If no designer shape can be found, this will return null.
/// </summary>
/// <param name="efobject"></param>
/// <returns></returns>
This method will return a DSL ShapeElement for the given efobject.  If the given efobject doesn't map to a designer shape,
then this will look for a designer shape for the object's parent.
If no designer shape can be found, this will return null.
This method will return a DSL ShapeElement for the given efobject . If the given efobject doesn ' t map to a designer shape then this will look for a designer shape for the object ' s parent . If no designer shape can be found this will return null .
private static ShapeElement GetDesignerShapeElementForEFObject(EntityDesignerDiagram diagram, EFObject efobject)
        {
            ShapeElement shapeElement = null;
            while (shapeElement == null
                   && efobject != null
                   && ((efobject is ConceptualEntityModel) == false))
            {
                var dslElement = diagram.ModelElement.ModelXRef.GetExisting(efobject);
                shapeElement = dslElement as ShapeElement;
                if (shapeElement == null
                    && dslElement != null)
                {
                    var shapes = PresentationViewsSubject.GetPresentation(dslElement);
                    if (shapes != null
                        && shapes.Count > 0)
                    {
                        shapeElement = shapes[0] as ShapeElement;
                    }
                }
                if (shapeElement == null)
                {
                    efobject = efobject.Parent;
                }
            }
            return shapeElement;
        }
private static ShapeElement GetDesignerShapeElementForEFObject ( EntityDesignerDiagram diagram , EFObject efobject ) { ShapeElement shapeElement = null ; while ( shapeElement == null && efobject != null && ( ( efobject is ConceptualEntityModel ) == false ) ) { var dslElement = diagram . ModelElement . ModelXRef . GetExisting ( efobject ) ; shapeElement = dslElement as ShapeElement ; if ( shapeElement == null && dslElement != null ) { var shapes = PresentationViewsSubject . GetPresentation ( dslElement ) ; if ( shapes != null && shapes . Count > 0 ) { shapeElement = shapes [ 0 ] as ShapeElement ; } } if ( shapeElement == null ) { efobject = efobject . Parent ; } } return shapeElement ; }
This method will return a DSL ShapeElement for the given efobject.
This method will return a DSL ShapeElement for the given efobject .
// just select the first shape for this item // walk up the EFObject tree until we find a node that has a ShapeElement.
None
diagram
EntityDesignerDiagram
efobject
EFObject
None