Class
DrawingToolBase

Abstract base class for tools which draw something on the canvas.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public abstract class DrawingToolBase : PrimaryMouseToolBase, ITool, IMouseListener, IKeyboardListener

Inheritance: objectToolBasePrimaryMouseToolBaseDrawingToolBase

Derived Classes: PathToolPencilTool

Implements: IKeyboardListenerIMouseListenerITool

Inherited Members PrimaryMouseToolBase.Initialize(IGraphServiceLocator)PrimaryMouseToolBase.KeyUp(KeyArgs)PrimaryMouseToolBase.MouseDoubleClick(PointerArgs)PrimaryMouseToolBase.MouseMove(PointerArgs)PrimaryMouseToolBase.MouseUp(PointerArgs)PrimaryMouseToolBase.SelectionServicePrimaryMouseToolBase.HitTestServicePrimaryMouseToolBase.ServiceLocatorPrimaryMouseToolBase.HitItemPrimaryMouseToolBase.ActiveConnectorToolBase.DeactivateTool()ToolBase.ActivateTool()ToolBase.OnActivated()ToolBase.RestoreCursor()ToolBase.ToolServiceToolBase.GraphToolBase.IsEnabledToolBase.IsActiveToolBase.NameToolBase.InitialPointToolBase.Cursor

Constructors

DrawingToolBase(string)

Initializes a new instance of the DrawingToolBase class.

Declaration

cs-api-definition
protected DrawingToolBase(string name)

Parameters

name

string

Properties

AddShapeCommand

Gets or sets the ICommand for adding a shape to the diagram.

Declaration

cs-api-definition
protected CompositeCommand AddShapeCommand { get; set; }

Property Value

CompositeCommand

ControllerService

Gets the IControllerService service.

Declaration

cs-api-definition
public IControllerService ControllerService { get; }

Property Value

IControllerService

DrawingService

Gets the IDrawingService service.

Declaration

cs-api-definition
public IDrawingService DrawingService { get; }

Property Value

IDrawingService

UndoRedoService

Gets the IUndoRedoService service.

Declaration

cs-api-definition
public IUndoRedoService UndoRedoService { get; }

Property Value

IUndoRedoService

Methods

CompleteTool()

Completes the action of this tool.

Declaration

cs-api-definition
public virtual void CompleteTool()

CreateShape()

Creates a shape.

Declaration

cs-api-definition
protected IGeometryShape CreateShape()

Returns

IGeometryShape

KeyDown(KeyArgs)

Handles the key down event.

Declaration

cs-api-definition
public override bool KeyDown(KeyArgs key)

Parameters

key

KeyArgs

Returns

bool

Overrides PrimaryMouseToolBase.KeyDown(KeyArgs)

MouseDown(PointerArgs)

Handles the mouse-down event.

Declaration

cs-api-definition
public override bool MouseDown(PointerArgs e)

Parameters

e

PointerArgs

The PointerArgs instance containing the event data.

Returns

bool

Overrides PrimaryMouseToolBase.MouseDown(PointerArgs)

OnDeactivated()

Called when tool is IsActive is changed to false.

Declaration

cs-api-definition
protected override void OnDeactivated()

Overrides ToolBase.OnDeactivated()

UndoToolAction()

Undoes what this tool has performed.

Declaration

cs-api-definition
public virtual void UndoToolAction()