ServiceManager.Publish Method (Type, PublishServiceCallback)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Exception Condition
ArgumentNullException

serviceType or callback is null.

ArgumentException

serviceType has already been published.

.NET Framework
Available since 4.0
Return to top
Show: