Back to Devexpress

Workbook.ReplaceService<T>(T) Method

officefileapi-devexpress-dot-spreadsheet-dot-workbook-dot-replaceservice-1-x28-0-x29.md

latest2.2 KB
Original Source

Workbook.ReplaceService<T>(T) Method

Performs a service substitution.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

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

Parameters

NameTypeDescription
newServiceT

A service of the specified type that will be registered.

|

Type Parameters

NameDescription
T

The type of service to register.

|

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 Workbook.GetService -> Workbook.RemoveService -> Workbook.AddService method sequence.

See Also

GetService(Type)

RemoveService

AddService

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace