Back to Devexpress

IRichEditDocumentServer.ReplaceService<T>(T) Method

officefileapi-devexpress-dot-xtrarichedit-dot-iricheditdocumentserver-dot-replaceservice-1-x28-0-x29.md

latest1.7 KB
Original Source

IRichEditDocumentServer.ReplaceService<T>(T) Method

Performs a service substitution.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
T ReplaceService<T>(
    T newService
)
    where T : class
vb
Function ReplaceService(Of T As Class)(
    newService As T
) As T

Parameters

NameTypeDescription
newServiceT

A service of the specified type that will replace the former service.

|

Type Parameters

NameDescription
T

The type of service to replace.

|

Returns

TypeDescription
T

Previously registered service of the specified type, or null ( Nothing in Visual Basic) if the service does not exist.

|

Remarks

Use the ReplaceService<T> method instead of the IRichEditDocumentServer.GetService<T> -> RemoveService -> AddService method sequence.

See Also

IRichEditDocumentServer Interface

IRichEditDocumentServer Members

DevExpress.XtraRichEdit Namespace