Compartilhar via


BrokeredServiceFactory Delegate

Definition

A delegate that creates new instances of a service to be exposed by an IServiceBroker.

public delegate System::Threading::Tasks::ValueTask<System::Object ^> BrokeredServiceFactory(ServiceMoniker ^ moniker, ServiceActivationOptions options, IServiceBroker ^ serviceBroker, CancellationToken cancellationToken);
public delegate System.Threading.Tasks.ValueTask<object?> BrokeredServiceFactory(ServiceMoniker moniker, ServiceActivationOptions options, IServiceBroker serviceBroker, CancellationToken cancellationToken);
type BrokeredServiceFactory = delegate of ServiceMoniker * ServiceActivationOptions * IServiceBroker * CancellationToken -> ValueTask<obj>
Public Delegate Function BrokeredServiceFactory(moniker As ServiceMoniker, options As ServiceActivationOptions, serviceBroker As IServiceBroker, cancellationToken As CancellationToken) As ValueTask(Of Object) 

Parameters

moniker
ServiceMoniker

The identifier for the service that is requested.

options
ServiceActivationOptions

Additional options that alter how the service may be activated or provide additional data to the service constructor.

serviceBroker
IServiceBroker

The service broker that the service returned from this delegate should use to obtain any of its own dependencies.

cancellationToken
CancellationToken

A token to indicate that the caller has lost interest in the result.

Return Value

A unique instance of the service. If the value implements IDisposable, the value will be disposed when the client disconnects.

Applies to

See also