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

Represents a class that can return and register services.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public class ServiceLocator : IServiceLocator, IGraphServiceLocator

Inheritance: objectServiceLocator

Implements: IGraphServiceLocatorIServiceLocator

Constructors

Initializes a new instance of the ServiceLocator class.

C#
public ServiceLocator(IGraphInternal graph, IControllerService controller)
Parameters:graphIGraphInternalcontrollerIControllerService

Methods

Gets a service.

C#
public T GetService<T>()
Returns:

T

Implements: IServiceLocator.GetService<T>()

Registers new service.

C#
public void Register<T>(T service)
Parameters:serviceT

The service.

Implements: IServiceLocator.Register<T>(T)

Registers the default services.

C#
public void RegisterDefaultServices()

Implements: IServiceLocator.RegisterDefaultServices()

Events

Occurs when a service is registered.

C#
public event EventHandler<ServiceRegisterEventArgs> ServiceRegistered

Implements: IServiceLocator.ServiceRegistered