Class
DrawingService

Represents drawing service.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class DrawingService : GraphServiceBase, IDrawingService

Inheritance: objectGraphServiceBaseDrawingService

Implements: IDrawingService

Inherited Members GraphServiceBase.Graph

Constructors

DrawingService(IGraphInternal)

Initializes a new instance of the DrawingService class.

Declaration

cs-api-definition
public DrawingService(IGraphInternal graph)

Parameters

graph

IGraphInternal

The graph.

Properties

ActiveShape

Gets the active shape.

Declaration

cs-api-definition
public IGeometryShape ActiveShape { get; }

Property Value

IGeometryShape

Implements IDrawingService.ActiveShape

AnchorPoints

Gets the anchor points.

Declaration

cs-api-definition
public IEnumerable<Point> AnchorPoints { get; }

Property Value

IEnumerable<Point>

Implements IDrawingService.AnchorPoints

ControlPoints

Gets the control points.

Declaration

cs-api-definition
public IEnumerable<Point> ControlPoints { get; }

Property Value

IEnumerable<Point>

Implements IDrawingService.ControlPoints

IsDrawing

Gets a value indicating whether this instance is drawing.

Declaration

cs-api-definition
public bool IsDrawing { get; }

Property Value

bool

Implements IDrawingService.IsDrawing

Methods

ClearPoints()

Clears the anchor and control points.

Declaration

cs-api-definition
public void ClearPoints()

Implements IDrawingService.ClearPoints()

CompleteDraw()

Completes the draw.

Declaration

cs-api-definition
public virtual void CompleteDraw()

Implements IDrawingService.CompleteDraw()

CreateDrawCommand(IGeometryShape, DrawingState, DrawingState, bool, bool, DrawingShapeInfo)

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

Declaration

cs-api-definition
public DrawCommand CreateDrawCommand(IGeometryShape shape, DrawingState oldState, DrawingState newState, bool isComplete, bool isUndoable, DrawingShapeInfo shapeInfo)

Parameters

shape

IGeometryShape

oldState

DrawingState

newState

DrawingState

isComplete

bool

isUndoable

bool

shapeInfo

DrawingShapeInfo

Returns

DrawCommand

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

CreateHandlesGeometry(Point, Point, FillRule)

Create geometry for the Path Handles in Path Tool.

Declaration

cs-api-definition
public Geometry CreateHandlesGeometry(Point startPoint, Point endPoint, FillRule fillRule)

Parameters

startPoint

Point

endPoint

Point

fillRule

FillRule

Returns

Geometry

Implements IDrawingService.CreateHandlesGeometry(Point, Point, FillRule)

CreateShapeGeometry(IEnumerable<DrawingToolSegment>, DrawingShapeInfo)

Creates Geometry for a shape from a given DrawingToolSegments.

Declaration

cs-api-definition
public Geometry CreateShapeGeometry(IEnumerable<DrawingToolSegment> segments, DrawingShapeInfo shapeInfo)

Parameters

segments

IEnumerable<DrawingToolSegment>

shapeInfo

DrawingShapeInfo

Returns

Geometry

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

DrawPoints(Point?, Point?, bool)

Draws the points.

Declaration

cs-api-definition
public virtual bool DrawPoints(Point? anchorPoint, Point? controlPoint, bool isUndoable = false)

Parameters

anchorPoint

Point?

The anchor point.

controlPoint

Point?

The control point.

isUndoable

bool

The is undoable.

Returns

bool

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

InitializeDraw(IGeometryShape, string)

Initializes draw action.

Declaration

cs-api-definition
public virtual void InitializeDraw(IGeometryShape activeShape, string toolName)

Parameters

activeShape

IGeometryShape

The active shape.

toolName

string

The name of the current tool.

Implements IDrawingService.InitializeDraw(IGeometryShape, string)

RemoveLastAnchorPoint()

Removes the last anchor point.

Declaration

cs-api-definition
public void RemoveLastAnchorPoint()

Implements IDrawingService.RemoveLastAnchorPoint()

RemoveLastControlPoint()

Removes the last control point.

Declaration

cs-api-definition
public void RemoveLastControlPoint()

Implements IDrawingService.RemoveLastControlPoint()

SetState(IGeometryShape, IEnumerable<Point>, IEnumerable<Point>)

Sets the state.

Declaration

cs-api-definition
public void SetState(IGeometryShape shape, IEnumerable<Point> anchorPoints, IEnumerable<Point> controlPoints)

Parameters

shape

IGeometryShape

The shape.

anchorPoints

IEnumerable<Point>

The anchor points.

controlPoints

IEnumerable<Point>

The control points.

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

StartDraw()

Starts the draw.

Declaration

cs-api-definition
public virtual void StartDraw()

Implements IDrawingService.StartDraw()

Events

Drawing

Occurs when drawing.

Declaration

cs-api-definition
public event EventHandler<DrawingEventArgs> Drawing

Event Value

EventHandler<DrawingEventArgs>

Implements IDrawingService.Drawing