Back to Devexpress

SchedulerControl.RemoveService(Type) Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-removeservice-x28-system-dot-type-x29.md

latest4.8 KB
Original Source

SchedulerControl.RemoveService(Type) Method

Removes the service of specified type from the service container.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public void RemoveService(
    Type serviceType
)
vb
Public Sub RemoveService(
    serviceType As Type
)

Parameters

NameTypeDescription
serviceTypeType

The type of service to remove.

|

Remarks

The SchedulerControl implements IServiceProvider and IServiceContainer interfaces. In addition to providing services, it also provides a mechanism for adding and removing services. To obtain a service, call the SchedulerControl.GetService method.

For more information review the Introduction to Services in XtraScheduler topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RemoveService(Type) 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-formatting-services/CS/FormattingServicesExample/Form1.cs#L56

csharp
if (checkButton1.Checked) {
    schedulerControl1.RemoveService(typeof(IAppointmentFormatStringService));
    schedulerControl1.AddService(typeof(IAppointmentFormatStringService), customAppointmentFormatStringService);

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

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

winforms-scheduler-formatting-services/VB/FormattingServicesExample/Form1.vb#L64

vb
If checkButton1.Checked Then
    schedulerControl1.RemoveService(GetType(IAppointmentFormatStringService))
    schedulerControl1.AddService(GetType(IAppointmentFormatStringService), customAppointmentFormatStringService)

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

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

See Also

Services

GetService(Type)

AddService

Services

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace