Back to Devexpress

SchedulerControl.GetService<T>() Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-getservice-1.md

latest3.7 KB
Original Source

SchedulerControl.GetService<T>() Method

Gets the service object of the specified generic type.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public virtual T GetService<T>()
vb
Public Overridable Function GetService(Of T) As T

Type Parameters

Name
T

Returns

TypeDescription
T

A service object of the specified generic type, or a null reference (Nothing in Visual Basic) if there is no service object of this type.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetService<T>() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-scheduler-replace-default-command/CS/WindowsFormsApplication1/Form1.cs#L28

csharp
CustomSchedulerCommandFactoryService commandFactory =
new CustomSchedulerCommandFactoryService(schedulerControl1, schedulerControl1.GetService<ISchedulerCommandFactoryService>());
schedulerControl1.RemoveService(typeof(ISchedulerCommandFactoryService));

winforms-scheduler-customize-popup-menu/CS/PopupMenuCustomization/Form1.cs#L53

csharp
// Create a menu item for the Scheduler command.
ISchedulerCommandFactoryService service = schedulerControl1.GetService<ISchedulerCommandFactoryService>();
SchedulerCommand cmd = service.CreateCommand(SchedulerCommandId.SwitchToGroupByResource);

winforms-scheduler-replace-default-command/VB/WindowsFormsApplication1/Form1.vb#L28

vb
InitAppointments()
Dim commandFactory As New CustomSchedulerCommandFactoryService(schedulerControl1, schedulerControl1.GetService(Of ISchedulerCommandFactoryService)())
schedulerControl1.RemoveService(GetType(ISchedulerCommandFactoryService))

winforms-scheduler-customize-popup-menu/VB/PopupMenuCustomization/Form1.vb#L45

vb
' Create a menu item for the Scheduler command.
Dim service As ISchedulerCommandFactoryService = schedulerControl1.GetService(Of ISchedulerCommandFactoryService)()
Dim cmd As SchedulerCommand = service.CreateCommand(SchedulerCommandId.SwitchToGroupByResource)

See Also

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace