ServiceManager.Publish ServiceManager.Publish ServiceManager.Publish ServiceManager.Publish Method

Definition

Publishes the given 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.

Overloads

Publish(Type, Object) Publish(Type, Object) Publish(Type, Object) Publish(Type, Object)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback)

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.

Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>)

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

Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

Publish(Type, Object) Publish(Type, Object) Publish(Type, Object) Publish(Type, Object)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

public:
 abstract void Publish(Type ^ serviceType, System::Object ^ serviceInstance);
public abstract void Publish (Type serviceType, object serviceInstance);
abstract member Publish : Type * obj -> unit
Public MustOverride Sub Publish (serviceType As Type, serviceInstance As Object)

Parameters

serviceType
Type Type Type Type

The type of service to publish.

serviceInstance
Object Object Object Object

An instance of the service.

Exceptions

serviceInstance does not derive from or implement serviceType, or serviceType has already been published.

Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback) Publish(Type, PublishServiceCallback)

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.

public:
 abstract void Publish(Type ^ serviceType, System::Activities::Presentation::PublishServiceCallback ^ callback);
public abstract void Publish (Type serviceType, System.Activities.Presentation.PublishServiceCallback callback);
abstract member Publish : Type * System.Activities.Presentation.PublishServiceCallback -> unit
Public MustOverride Sub Publish (serviceType As Type, callback As PublishServiceCallback)

Parameters

serviceType
Type Type Type Type

The type of service to publish.

callback
PublishServiceCallback PublishServiceCallback PublishServiceCallback PublishServiceCallback

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

Exceptions

Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>) Publish<TServiceType>(PublishServiceCallback<TServiceType>)

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

public:
generic <typename TServiceType>
 void Publish(System::Activities::Presentation::PublishServiceCallback<TServiceType> ^ callback);
public void Publish<TServiceType> (System.Activities.Presentation.PublishServiceCallback<TServiceType> callback);
member this.Publish : System.Activities.Presentation.PublishServiceCallback<'ServiceType> -> unit
Public Sub Publish(Of TServiceType) (callback As PublishServiceCallback(Of TServiceType))

Type Parameters

TServiceType

The type of the service to publish.

Parameters

Exceptions

Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType) Publish<TServiceType>(TServiceType)

Publishes the given service. After it is published, the service instance remains in the service manager until the editing context is disposed of.

public:
generic <typename TServiceType>
 void Publish(TServiceType serviceInstance);
public void Publish<TServiceType> (TServiceType serviceInstance);
member this.Publish : 'ServiceType -> unit
Public Sub Publish(Of TServiceType) (serviceInstance As TServiceType)

Type Parameters

TServiceType

The type of the service to publish.

Parameters

serviceInstance
TServiceType TServiceType TServiceType TServiceType

An instance of the service.

Exceptions

Applies to