Class LayoutManager
Base class for layout managers.
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public abstract class LayoutManager : Component
Remarks
This class provides the basic plumbing for layout managers. A layout manager is an object that controls the positioning of nodes in a model. Each layout manager object is attached to a single model by the Model property.
Layout managers can operate one of two modes: manual or auto-update. When the AutoLayout flag is set to True, the layout manager responds to events in the model by automatically repositioning nodes in the model. The UpdateLayout(Object) method can be called at any time to reposition the nodes in the model. If the AutoLayout flag is False, then UpdateLayout must be called manually in order to update the layout of nodes in the model.
ModelConstructors
LayoutManager()
Initializes a new instance of the LayoutManager class.
Declaration
public LayoutManager()
LayoutManager(Model)
Initializes a new instance of the LayoutManager class.
Declaration
public LayoutManager(Model model)
Parameters
Type | Name | Description |
---|---|---|
Model | model | The model. |
Fields
autoLayoutFlag
Flag indicating if layout is to be updated automatically.
Declaration
protected bool autoLayoutFlag
Field Value
Type |
---|
System.Boolean |
LayoutUpdated
Fired after the layout has been updated by the layout manager.
Declaration
public EventHandler LayoutUpdated
Field Value
Type |
---|
System.EventHandler |
mdl
Reference to model and layout.
Declaration
protected Model mdl
Field Value
Type |
---|
Model |
Properties
AutoLayout
Gets or sets a value indicating whether the layout manager automatically updates the layout of the model.
Declaration
public bool AutoLayout { get; set; }
Property Value
Type |
---|
System.Boolean |
LeftMargin
Gets or Sets the left margin for the layout manager.
Declaration
public float LeftMargin { get; set; }
Property Value
Type |
---|
System.Single |
Model
Gets or sets the model attached to this layout manager.
Declaration
public Model Model { get; set; }
Property Value
Type |
---|
Model |
Remarks
The model referenced by this property is updated when the UpdateLayout method is called.
Nodes
Gets the nodes collection by who will apply layout.
Declaration
public NodeCollection Nodes { get; }
Property Value
Type | Description |
---|---|
NodeCollection | The nodes collection. |
TopMargin
Gets or Sets the top margin for the layout manager.
Declaration
public float TopMargin { get; set; }
Property Value
Type |
---|
System.Single |
UpdatingLayout
Gets or sets a value indicating whether layout update state.
Declaration
protected bool UpdatingLayout { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
OnConnectionsChanged(CollectionExEventArgs)
Called when connection collections is changed.
Declaration
protected virtual void OnConnectionsChanged(CollectionExEventArgs evtArgs)
Parameters
Type | Name | Description |
---|---|---|
CollectionExEventArgs | evtArgs | The CollectionExEventArgs instance containing the event data. |
OnLayoutUpdated(EventArgs)
Called after the layout has been updated by the layout manager.
Declaration
protected virtual void OnLayoutUpdated(EventArgs evtArgs)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | evtArgs | Event arguments. |
OnNodeCollectionChanged(CollectionExEventArgs)
Called when nodes are added or removed from the model.
Declaration
protected virtual void OnNodeCollectionChanged(CollectionExEventArgs evtArgs)
Parameters
Type | Name | Description |
---|---|---|
CollectionExEventArgs | evtArgs | Event arguments. |
OnPropertyChanged(PropertyChangedEventArgs)
Called when one or more nodes in the model are has change properties.
Declaration
protected virtual void OnPropertyChanged(PropertyChangedEventArgs evtArgs)
Parameters
Type | Name | Description |
---|---|---|
PropertyChangedEventArgs | evtArgs | The event args. |
UpdateLayout(Object)
Updates the layout of the nodes in the model.
Declaration
public abstract bool UpdateLayout(object contextInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Object | contextInfo | Provides context information to help with updating the layout. |
Returns
Type | Description |
---|---|
System.Boolean | True if changes were made; otherwise False. |