Class
ToolService

The toolbox, this tells the application which tools are available.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class ToolService : GraphServiceBase, IToolService, IMouseListener, IKeyboardListener

Inheritance: objectGraphServiceBaseToolService

Implements: IKeyboardListenerIMouseListenerIToolService

Constructors

ToolService(IGraphInternal, IGraphServiceLocator)

Initializes a new instance of the ToolService class.

Declaration

cs-api-definition
public ToolService(IGraphInternal graph, IGraphServiceLocator serviceLocator)

Parameters

graph

IGraphInternal

The graph.

serviceLocator

IGraphServiceLocator

The service locator.

Properties

ActiveTool

Gets the active tool.

Declaration

cs-api-definition
public ITool ActiveTool { get; }

Property Value

ITool

Implements IToolService.ActiveTool

Graph

Gets the graph.

Declaration

cs-api-definition
public IGraphInternal Graph { get; }

Property Value

IGraphInternal

Implements IToolService.Graph

IsAltDown

Gets or sets whether the alt-key is pressed.

Declaration

cs-api-definition
public bool IsAltDown { get; set; }

Property Value

bool

Implements IToolService.IsAltDown

IsControlDown

Gets or sets whether the control-key is pressed.

Declaration

cs-api-definition
public bool IsControlDown { get; set; }

Property Value

bool

Implements IToolService.IsControlDown

IsMouseDown

Declaration

cs-api-definition
public bool IsMouseDown { get; set; }

Property Value

bool

Implements IToolService.IsMouseDown

PrimaryTool

Gets or sets the primary tool.

Declaration

cs-api-definition
public string PrimaryTool { get; set; }

Property Value

string

The primary tool.

Implements IToolService.PrimaryTool

ToolList

Gets the tools collection.

Declaration

cs-api-definition
public ObservableCollection<ITool> ToolList { get; }

Property Value

ObservableCollection<ITool>

Methods

ActivatePrimaryTool()

Activates the primary tool.

Declaration

cs-api-definition
public void ActivatePrimaryTool()

Implements IToolService.ActivatePrimaryTool()

ActivateTool(string)

Activates the tool.

Declaration

cs-api-definition
public ITool ActivateTool(string toolName)

Parameters

toolName

string

Label of the tool.

Returns

ITool

Implements IToolService.ActivateTool(string)

DeactivateTool(ITool)

Deactivates the given tool.

Declaration

cs-api-definition
public bool DeactivateTool(ITool tool)

Parameters

tool

ITool

A registered ITool.

Returns

bool

Implements IToolService.DeactivateTool(ITool)

FindTool(string)

Returns the tool with the specified name, if it exists.

Declaration

cs-api-definition
public ITool FindTool(string name)

Parameters

name

string

Returns

ITool

Implements IToolService.FindTool(string)

KeyDown(KeyArgs)

Handles the key down event.

Declaration

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

Parameters

key

KeyArgs

Returns

bool

Implements IKeyboardListener.KeyDown(KeyArgs)

KeyUp(KeyArgs)

Handles the key up event.

Declaration

cs-api-definition
public bool KeyUp(KeyArgs key)

Parameters

key

KeyArgs

Returns

bool

Implements IKeyboardListener.KeyUp(KeyArgs)

MouseDoubleClick(PointerArgs)

Handles the mouse double click event.

Declaration

cs-api-definition
public bool MouseDoubleClick(PointerArgs e)

Parameters

e

PointerArgs

The PointerArgs instance containing the event data.

Returns

bool

Implements IMouseListener.MouseDoubleClick(PointerArgs)

MouseDown(PointerArgs)

Handles the mouse-down event.

Declaration

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

Parameters

e

PointerArgs

The PointerArgs instance containing the event data.

Returns

bool

Implements IMouseListener.MouseDown(PointerArgs)

MouseMove(PointerArgs)

Handles the mouse-move event.

Declaration

cs-api-definition
public bool MouseMove(PointerArgs e)

Parameters

e

PointerArgs

The PointerArgs instance containing the event data.

Returns

bool

Implements IMouseListener.MouseMove(PointerArgs)

MouseUp(PointerArgs)

Handles the mouse-up event.

Declaration

cs-api-definition
public bool MouseUp(PointerArgs e)

Parameters

e

PointerArgs

The PointerArgs instance containing the event data.

Returns

bool

Implements IMouseListener.MouseUp(PointerArgs)