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

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

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class ToolService : GraphServiceBase, IToolService, IMouseListener, IKeyboardListener

Inheritance: objectGraphServiceBaseToolService

Implements: IKeyboardListenerIMouseListenerIToolService

Constructors

Initializes a new instance of the ToolService class.

C#
public ToolService(IGraphInternal graph, IGraphServiceLocator serviceLocator)
Parameters:graphIGraphInternal

The graph.

serviceLocatorIGraphServiceLocator

The service locator.

Properties

Gets the active tool.

C#
public ITool ActiveTool { get; }

Implements: IToolService.ActiveTool

Gets the graph.

C#
public IGraphInternal Graph { get; }

Implements: IToolService.Graph

Gets or sets whether the alt-key is pressed.

C#
public bool IsAltDown { get; set; }

Implements: IToolService.IsAltDown

Gets or sets whether the control-key is pressed.

C#
public bool IsControlDown { get; set; }

Implements: IToolService.IsControlDown

C#
public bool IsMouseDown { get; set; }

Implements: IToolService.IsMouseDown

Gets or sets the primary tool.

C#
public string PrimaryTool { get; set; }
Property Value:

The primary tool.

Implements: IToolService.PrimaryTool

Gets the tools collection.

C#
public ObservableCollection<ITool> ToolList { get; }

Methods

Activates the primary tool.

C#
public void ActivatePrimaryTool()

Implements: IToolService.ActivatePrimaryTool()

Activates the tool.

C#
public ITool ActivateTool(string toolName)
Parameters:toolNamestring

Label of the tool.

Returns:

ITool

Implements: IToolService.ActivateTool(string)

Deactivates the given tool.

C#
public bool DeactivateTool(ITool tool)
Parameters:toolITool

A registered ITool.

Returns:

bool

Implements: IToolService.DeactivateTool(ITool)

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

C#
public ITool FindTool(string name)
Parameters:namestringReturns:

ITool

Implements: IToolService.FindTool(string)

Handles the key down event.

C#
public bool KeyDown(KeyArgs key)
Parameters:keyKeyArgsReturns:

bool

Implements: IKeyboardListener.KeyDown(KeyArgs)

Handles the key up event.

C#
public bool KeyUp(KeyArgs key)
Parameters:keyKeyArgsReturns:

bool

Implements: IKeyboardListener.KeyUp(KeyArgs)

Handles the mouse double click event.

C#
public bool MouseDoubleClick(PointerArgs e)
Parameters:ePointerArgs

The PointerArgs instance containing the event data.

Returns:

bool

Implements: IMouseListener.MouseDoubleClick(PointerArgs)

Handles the mouse-down event.

C#
public bool MouseDown(PointerArgs e)
Parameters:ePointerArgs

The PointerArgs instance containing the event data.

Returns:

bool

Implements: IMouseListener.MouseDown(PointerArgs)

Handles the mouse-move event.

C#
public bool MouseMove(PointerArgs e)
Parameters:ePointerArgs

The PointerArgs instance containing the event data.

Returns:

bool

Implements: IMouseListener.MouseMove(PointerArgs)

Handles the mouse-up event.

C#
public bool MouseUp(PointerArgs e)
Parameters:ePointerArgs

The PointerArgs instance containing the event data.

Returns:

bool

Implements: IMouseListener.MouseUp(PointerArgs)