共用方式為


ShapeElement.OnBoundsFixup Method

Called when the bounds position and size of the parent and children are set or adjusted. Override to modify the size or internal layout.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

Syntax

'Declaration
Public Overridable Sub OnBoundsFixup ( _
    fixupState As BoundsFixupState, _
    iteration As Integer, _
    createdDuringViewFixup As Boolean _
)
public virtual void OnBoundsFixup(
    BoundsFixupState fixupState,
    int iteration,
    bool createdDuringViewFixup
)
public:
virtual void OnBoundsFixup(
    BoundsFixupState fixupState, 
    int iteration, 
    bool createdDuringViewFixup
)
abstract OnBoundsFixup : 
        fixupState:BoundsFixupState * 
        iteration:int * 
        createdDuringViewFixup:bool -> unit  
override OnBoundsFixup : 
        fixupState:BoundsFixupState * 
        iteration:int * 
        createdDuringViewFixup:bool -> unit
public function OnBoundsFixup(
    fixupState : BoundsFixupState, 
    iteration : int, 
    createdDuringViewFixup : boolean
)

Parameters

  • iteration
    Type: System.Int32

    The number of times called on this object in this transaction. Used to avoid layout loops caused by conflicting rules. If this number exceeds a small limit, do not make further changes.

  • createdDuringViewFixup
    Type: System.Boolean

    true to indicate that a child shape was created when the elements in the view were adjusted; otherwise, false.

Examples

public override void OnBoundsFixup(DslDiagrams::BoundsFixupState fixupState, int iteration, bool createdDuringViewFixup)
{
base.OnBoundsFixup(fixupState, iteration, createdDuringViewFixup);

if(iteration == 0)
{
foreach(DslDiagrams::Decorator decorator in this.Decorators)
{
if(decorator.RequiresHost)
{
decorator.RepositionHostShape(decorator.GetHostShape(this));
}
}
}
}

.NET Framework Security

See Also

Reference

ShapeElement Class

Microsoft.VisualStudio.Modeling.Diagrams Namespace