Share via


ExportBrokeredServiceAttribute Class

Definition

Exports a class as a brokered service.

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=false)]
[System.ComponentModel.Composition.MetadataAttribute]
public class ExportBrokeredServiceAttribute : System.ComponentModel.Composition.ExportAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=false)>]
[<System.ComponentModel.Composition.MetadataAttribute>]
type ExportBrokeredServiceAttribute = class
    inherit ExportAttribute
Public Class ExportBrokeredServiceAttribute
Inherits ExportAttribute
Inheritance
ExportBrokeredServiceAttribute
Attributes

Remarks

The class that this attribute is applied to must implement IExportedBrokeredService.

Any other MEF attributes used by the class with this attribute applied should come from the System.ComponentModel.Composition namespace.

This attribute may be applied multiple times if multiple versions of the brokered service are supported.

Exported brokered services may import any other MEF export from the default scope, along with the following types (with no explicit contract name):

Brokered services may not import other brokered service. They must use IServiceBroker to acquire them.

Constructors

ExportBrokeredServiceAttribute(String, String, Type[])

Initializes a new instance of the ExportBrokeredServiceAttribute class.

ExportBrokeredServiceAttribute(String, String)

Initializes a new instance of the ExportBrokeredServiceAttribute class.

Properties

AllowTransitiveGuestClients

Gets or sets a value indicating whether guest clients are allowed to transitively acquire this service. By default (false), only owners are allowed to access a brokered service. To opt-in to allowing guests to acquire the proffered service, set this to true. By setting this to true the service now has sole responsibility in correctly using IAuthorizationService to authorize sensitive operations.

Audience

Gets or sets a value indicating which clients should be allowed to directly acquire this service. Audiences may be bitwise-OR'd together to expand the set of clients that are allowed to acquire this service.

OptionalInterfacesImplemented

Gets an array of assembly-qualified names of optional interfaces that the exported brokered service implements.

ServiceName

Gets the Name of the exported brokered service.

ServiceVersion

Gets the Version of the exported brokered service.

Applies to