src/Misc/EFTools/EntityDesignEntityDesigner/CustomCode/Diagram/EntityDesignerDiagram.cs
/// <summary>
///     Helper function to expand or collapse entity type shape.
/// </summary>
/// <param name="shapeElements">Shape elements collection.</param>
/// <param name="isExpanded">a flag that indicates whether the shape to be expanded or not.</param>
Helper function to expand or collapse entity type shape.
Helper function to expand or collapse entity type shape .
private void SetEntityShapesExpanded(IList<ShapeElement> shapeElements, bool isExpanded)
        {
            var entityShapeChanged = false;
            using (new VsUtils.HourglassHelper())
            {
                using (var t = Store.TransactionManager.BeginTransaction(EntityDesignerResources.Tx_SetEntityTypeIsExpandedProperty))
                {
                    t.Context.Add(EfiTransactionOriginator.TransactionOriginatorDiagramId, DiagramId);
                    foreach (var shape in shapeElements)
                    {
                        var entityShape = shape as EntityTypeShape;
                        if (entityShape != null)
                        {
                            if (isExpanded != entityShape.IsExpanded)
                            {
                                entityShape.IsExpanded = isExpanded;
                                entityShapeChanged = true;
                            }
                        }
                    }
                    if (entityShapeChanged)
                    {
                        t.Commit();
                    }
                }
            }
        }
private void SetEntityShapesExpanded ( IList < ShapeElement > shapeElements , bool isExpanded ) { var entityShapeChanged = false ; using ( new VsUtils . HourglassHelper ( ) ) { using ( var t = Store . TransactionManager . BeginTransaction ( EntityDesignerResources . Tx_SetEntityTypeIsExpandedProperty ) ) { t . Context . Add ( EfiTransactionOriginator . TransactionOriginatorDiagramId , DiagramId ) ; foreach ( var shape in shapeElements ) { var entityShape = shape as EntityTypeShape ; if ( entityShape != null ) { if ( isExpanded != entityShape . IsExpanded ) { entityShape . IsExpanded = isExpanded ; entityShapeChanged = true ; } } } if ( entityShapeChanged ) { t . Commit ( ) ; } } } }
Helper function to expand or collapse entity type shape.
Helper function to expand or collapse entity type shape .
// Put up an hourglass because this may take a while // only commit if there is a change.
shapeElements
IList<ShapeElement>
Shape elements collection.
Shape elements collection .
isExpanded
bool
a flag that indicates whether the shape to be expanded or not.
a flag that indicates whether the shape to be expanded or not .