New to Telerik UI for WinFormsStart a free 30-day trial

Represents drawing service.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class DrawingService : GraphServiceBase, IDrawingService

Inheritance: objectGraphServiceBaseDrawingService

Implements: IDrawingService

Inherited Members GraphServiceBase.Graph

Constructors

Initializes a new instance of the DrawingService class.

C#
public DrawingService(IGraphInternal graph)
Parameters:graphIGraphInternal

The graph.

Properties

Gets the active shape.

C#
public IGeometryShape ActiveShape { get; }

Implements: IDrawingService.ActiveShape

AnchorPoints

IEnumerable<Point>

Gets the anchor points.

C#
public IEnumerable<Point> AnchorPoints { get; }

Implements: IDrawingService.AnchorPoints

ControlPoints

IEnumerable<Point>

Gets the control points.

C#
public IEnumerable<Point> ControlPoints { get; }

Implements: IDrawingService.ControlPoints

Gets a value indicating whether this instance is drawing.

C#
public bool IsDrawing { get; }

Implements: IDrawingService.IsDrawing

Methods

Clears the anchor and control points.

C#
public void ClearPoints()

Implements: IDrawingService.ClearPoints()

Completes the draw.

C#
public virtual void CompleteDraw()

Implements: IDrawingService.CompleteDraw()

Creates the DrawCommand that sets the new state of the Shape or reverts the old state.

C#
public DrawCommand CreateDrawCommand(IGeometryShape shape, DrawingState oldState, DrawingState newState, bool isComplete, bool isUndoable, DrawingShapeInfo shapeInfo)
Parameters:shapeIGeometryShapeoldStateDrawingStatenewStateDrawingStateisCompleteboolisUndoableboolshapeInfoDrawingShapeInfoReturns:

DrawCommand

Implements: IDrawingService.CreateDrawCommand(IGeometryShape, DrawingState, DrawingState, bool, bool, DrawingShapeInfo)

Create geometry for the Path Handles in Path Tool.

C#
public Geometry CreateHandlesGeometry(Point startPoint, Point endPoint, FillRule fillRule)
Parameters:startPointPointendPointPointfillRuleFillRuleReturns:

Geometry

Implements: IDrawingService.CreateHandlesGeometry(Point, Point, FillRule)

Creates Geometry for a shape from a given DrawingToolSegments.

C#
public Geometry CreateShapeGeometry(IEnumerable<DrawingToolSegment> segments, DrawingShapeInfo shapeInfo)
Parameters:segmentsIEnumerable<DrawingToolSegment>shapeInfoDrawingShapeInfoReturns:

Geometry

Implements: IDrawingService.CreateShapeGeometry(IEnumerable<DrawingToolSegment>, DrawingShapeInfo)

Draws the points.

C#
public virtual bool DrawPoints(Point? anchorPoint, Point? controlPoint, bool isUndoable = false)
Parameters:anchorPointPoint?

The anchor point.

controlPointPoint?

The control point.

isUndoablebool

The is undoable.

Returns:

bool

Implements: IDrawingService.DrawPoints(Point?, Point?, bool)

Initializes draw action.

C#
public virtual void InitializeDraw(IGeometryShape activeShape, string toolName)
Parameters:activeShapeIGeometryShape

The active shape.

toolNamestring

The name of the current tool.

Implements: IDrawingService.InitializeDraw(IGeometryShape, string)

Removes the last anchor point.

C#
public void RemoveLastAnchorPoint()

Implements: IDrawingService.RemoveLastAnchorPoint()

Removes the last control point.

C#
public void RemoveLastControlPoint()

Implements: IDrawingService.RemoveLastControlPoint()

Sets the state.

C#
public void SetState(IGeometryShape shape, IEnumerable<Point> anchorPoints, IEnumerable<Point> controlPoints)
Parameters:shapeIGeometryShape

The shape.

anchorPointsIEnumerable<Point>

The anchor points.

controlPointsIEnumerable<Point>

The control points.

Implements: IDrawingService.SetState(IGeometryShape, IEnumerable<Point>, IEnumerable<Point>)

Starts the draw.

C#
public virtual void StartDraw()

Implements: IDrawingService.StartDraw()

Events

Occurs when drawing.

C#
public event EventHandler<DrawingEventArgs> Drawing

Implements: IDrawingService.Drawing