Export (0) Print
Expand All

ServiceManager.Publish Method (Type, PublishServiceCallback)

.NET Framework 4.6 and 4.5

Publishes the specified service type, but does not declare an instance. When the service is requested, the Publish service callback will be invoked to create the instance. The callback is invoked only once. After that, the instance it returned is cached.

Namespace:  System.Activities.Presentation
Assembly:  System.Activities.Presentation (in System.Activities.Presentation.dll)

public abstract void Publish(
	Type serviceType,
	PublishServiceCallback callback
)

Parameters

serviceType
Type: System.Type

The type of service to publish.

callback
Type: System.Activities.Presentation.PublishServiceCallback

A callback that will be invoked when an instance of the service is needed.

ExceptionCondition
ArgumentNullException

serviceType or callback is null.

ArgumentException

serviceType has already been published.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft