Class Controller
Processes input events and translates them into actions on the diagram.
Inherited Members
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public class Controller : IServiceReferenceHolder, IServiceReferenceProvider, IDisposable
Remarks
The controller is an object that is responsible for handling input in the model-view-controller architecture. The controller receives input events and translates them into commands that affect the model and view.
This class is an abstract base class from which concrete controller classes are derived. This class does not does not register any tools.
View ModelConstructors
Controller()
Declaration
public Controller()
Fields
m_bNeedDocumentRefresh
Declaration
protected bool m_bNeedDocumentRefresh
Field Value
| Type |
|---|
| System.Boolean |
m_viewer
View attached to this controller.
Declaration
protected IViewer m_viewer
Field Value
| Type |
|---|
| IViewer |
Properties
CanUpdateView
Gets a value indicating whether this instance can update view.
Declaration
public bool CanUpdateView { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Constraint
Get or set the constraints value
Declaration
public Constraints Constraint { get; set; }
Property Value
| Type |
|---|
| Constraints |
DefaultConnectorTool
Declaration
public ConnectorTool DefaultConnectorTool { get; set; }
Property Value
| Type |
|---|
| ConnectorTool |
Model
Gets the Model object attached to this controller.
Declaration
public Model Model { get; }
Property Value
| Type |
|---|
| Model |
Remarks
The Model object is attached to the controller indirectly through the View object.
Provider
Gets the provider.
Declaration
protected IServiceReferenceProvider Provider { get; }
Property Value
| Type | Description |
|---|---|
| IServiceReferenceProvider | The provider. |
SelectionList
Gets list of nodes that are currently selected. Also, add the shapes programmatically by using the collection property if you need to select.
Declaration
public NodeCollection SelectionList { get; }
Property Value
| Type |
|---|
| NodeCollection |
UpdateInfo
Gets the update info.
Declaration
public UpdateInfo UpdateInfo { get; }
Property Value
| Type |
|---|
| UpdateInfo |
View
Gets the view.
Declaration
public View View { get; }
Property Value
| Type | Description |
|---|---|
| View | The view. |
Viewer
Gets the View object attached to this controller.
Declaration
public IViewer Viewer { get; }
Property Value
| Type |
|---|
| IViewer |
Methods
BringForward()
Visually brings the selected shapes one step forward over the nearest overlapping shape based on z-order value.
Declaration
public bool BringForward()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful; otherwise False. |
Remarks
This method creates and executes a ZOrderCmd command. ZOrderCmd SelectionList
BringIntoView(RectangleF)
BringIntoView selected bounds
Declaration
public void BringIntoView(RectangleF boundingRect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | boundingRect | boundingRect of selected bounds area |
BringToCenter(RectangleF)
BringToCenter selected bounds
Declaration
public void BringToCenter(RectangleF boundingRect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | boundingRect | boundingRect of selected bounds area |
BringToFront()
Visually brings the selected shapes front over all the other overlapped shapes based on z-order value.
Declaration
public bool BringToFront()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful; otherwise False. |
Remarks
This method creates and executes a ZOrderCmd command. ZOrderCmd SelectionList
CanAPIUpdate()
Has flag of the Constraints as APIUpdate
Declaration
public bool CanAPIUpdate()
Returns
| Type | Description |
|---|---|
| System.Boolean | return true/false |
CanUserInteraction()
Has flag of the Constraints as UserInteraction
Declaration
public bool CanUserInteraction()
Returns
| Type | Description |
|---|---|
| System.Boolean | return true/false |
ConvertFromModelToClientCoordinates(Point)
Converts from model to client coordinates.
Declaration
public Point ConvertFromModelToClientCoordinates(Point ptModelLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | ptModelLocation | The pt model location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Point | Point from model to client coordinates. |
ConvertFromModelToClientCoordinates(PointF)
Converts from model to client coordinates.
Declaration
public PointF ConvertFromModelToClientCoordinates(PointF ptModelLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | ptModelLocation | The pt model location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.PointF | Point from model to client coordinates. |
ConvertFromModelToClientCoordinates(Rectangle)
Converts from model to client coordinates.
Declaration
public Rectangle ConvertFromModelToClientCoordinates(Rectangle rectModel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | rectModel | The rect model. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Rectangle | Rect from model to client coordinates. |
ConvertFromModelToClientCoordinates(RectangleF)
Converts from model to client coordinates.
Declaration
public RectangleF ConvertFromModelToClientCoordinates(RectangleF rectModel)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | rectModel | The rect model. |
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | Rect from model to client coordinates. |
ConvertFromModelToClientCoordinates(Size)
Converts from model to client coordinates.
Declaration
public Size ConvertFromModelToClientCoordinates(Size size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Size | size | The size. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | Size from model to client coordinates. |
ConvertFromModelToClientCoordinates(SizeF)
Converts from model to client coordinates.
Declaration
public SizeF ConvertFromModelToClientCoordinates(SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.SizeF | size | The size. |
Returns
| Type | Description |
|---|---|
| System.Drawing.SizeF | Size from model to client coordinates. |
ConvertToModelCoordinates(Point)
Converts to model coordinates.
Declaration
public Point ConvertToModelCoordinates(Point ptClientLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Point | ptClientLocation | The pt client location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Point | Point in model coordinate. |
ConvertToModelCoordinates(PointF)
Converts to model coordinates.
Declaration
public PointF ConvertToModelCoordinates(PointF ptClientLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | ptClientLocation | The pt client location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.PointF | Points in model coordinates. |
ConvertToModelCoordinates(Rectangle)
Converts to model coordinates.
Declaration
public Rectangle ConvertToModelCoordinates(Rectangle rectClientLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | rectClientLocation | The rect client location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Rectangle | Rect in model coordinates. |
ConvertToModelCoordinates(RectangleF)
Converts to model coordinates.
Declaration
public RectangleF ConvertToModelCoordinates(RectangleF rectClientLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.RectangleF | rectClientLocation | The rect client location. |
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | Rect in model coordinates. |
ConvertToModelCoordinates(Size)
Convert size to model coordinate.
Declaration
public Size ConvertToModelCoordinates(Size size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Size | size | The size. |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | Size to model coordinates. |
ConvertToModelCoordinates(SizeF)
Convert size to model coordinate.
Declaration
public SizeF ConvertToModelCoordinates(SizeF size)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.SizeF | size | The size. |
Returns
| Type | Description |
|---|---|
| System.Drawing.SizeF | Size in model coordinates. |
Delete()
Deletes the selected nodes from the diagram.
Declaration
public void Delete()
Dispose()
Declaration
public virtual void Dispose()
Document_NodeCollectionChanged(CollectionExEventArgs)
Documents the node collection changed.
Declaration
[EventHandlerPriority(true)]
protected virtual void Document_NodeCollectionChanged(CollectionExEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectionExEventArgs | evtArgs | The CollectionExEventArgs instance containing the event data. |
Document_PropertyChanging(PropertyChangingEventArgs)
Raises when property is changing.
Declaration
[EventHandlerPriority(true)]
protected virtual void Document_PropertyChanging(PropertyChangingEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangingEventArgs | evtArgs | The PropertyChangingEventArgs instance containing the event data. |
EventSink_CancelCollectionChanged(CollectionExEventArgs)
Cancels the node collection changed event.
Declaration
[EventHandlerPriority(true)]
protected void EventSink_CancelCollectionChanged(CollectionExEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| CollectionExEventArgs | evtArgs | The CollectionExEventArgs instance containing the event data. |
EventSink_PropertyChanging(PropertyChangingEventArgs)
Events the sink property changing.
Declaration
[EventHandlerPriority(true)]
protected virtual void EventSink_PropertyChanging(PropertyChangingEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyChangingEventArgs | evtArgs | The PropertyChangingEventArgs instance containing the event data. |
GetBoundingRect(ICollection, MeasureUnits)
Gets the bounding rectangle from node collections.
Declaration
public virtual RectangleF GetBoundingRect(ICollection nodes, MeasureUnits units)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.ICollection | nodes | The nodes. |
| MeasureUnits | units | The units. |
Returns
| Type | Description |
|---|---|
| System.Drawing.RectangleF | Nodes bounding rectangle. |
Group()
Groups the currently selected nodes and connectors in a diagram. It will create sub-group also if the selected nodes contain another group.
Declaration
public void Group()
HistoryManager_CommandRequest(Object, EventArgs)
Handles the CommandRequest event of the HistoryManager control.
Declaration
[EventHandlerPriority(true)]
protected virtual void HistoryManager_CommandRequest(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The source of the event. |
| System.EventArgs | e | The System.EventArgs instance containing the event data. |
HistoryManager_CommandRequestComplete(Object, EventArgs)
Handles the CommandRequestComplete event of the HistoryManager control.
Declaration
[EventHandlerPriority(true)]
protected virtual void HistoryManager_CommandRequestComplete(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The source of the event. |
| System.EventArgs | e | The System.EventArgs instance containing the event data. |
HistoryManager_CommandStarted(Object, EventArgs)
Handles the CommandStarted event of the HistoryManager control.
Declaration
[EventHandlerPriority(true)]
protected virtual void HistoryManager_CommandStarted(object sender, EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | sender | The source of the event. |
| System.EventArgs | e | The System.EventArgs instance containing the event data. |
ProvideServiceReference(RuntimeTypeHandle)
Provides the service reference.
Declaration
public virtual object ProvideServiceReference(RuntimeTypeHandle typeHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| System.RuntimeTypeHandle | typeHandle | The type handle. |
Returns
| Type | Description |
|---|---|
| System.Object | The object. |
SelectAll()
Adds all nodes in the model to the SelectionList.
Declaration
public void SelectAll()
SendBackward()
Visually brings the selected shapes one step backward over the nearest overlapping shape based on z-order value.
Declaration
public bool SendBackward()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful; otherwise False. |
Remarks
This method creates and executes a ZOrderCmd command. ZOrderCmd SelectionList
SendToBack()
Visually brings the selected shapes back over all the other overlapped shapes based on z-order value.
Declaration
public bool SendToBack()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if successful; otherwise False. |
Remarks
This method creates and executes a ZOrderCmd command. ZOrderCmd SelectionList
UnGroup()
Ungroups currently selected group in a diagram. It ungroups the parent alone and not sub-group if selected group node contains sub-group.
Declaration
public void UnGroup()
UpdateServiceReferences(IServiceReferenceProvider)
Updates the service references from service provider.
Declaration
public virtual void UpdateServiceReferences(IServiceReferenceProvider provider)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceReferenceProvider | provider | The service provider. |
View_OriginChanged(ViewOriginEventArgs)
Handles the view origin changed event.
Declaration
[EventHandlerPriority(true)]
protected virtual void View_OriginChanged(ViewOriginEventArgs evtArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| ViewOriginEventArgs | evtArgs | The ViewOriginEventArgs instance containing the event data. |