編集

次の方法で共有


WorkflowInstanceExtensionManager.Add Method

Definition

Overloads

Add(Object)

Adds the specified extension to the collection of extensions.

Add<T>(Func<T>)

Registers a Func<TResult> that is used to provide an instance of an extension when requested by a workflow instance.

Add(Object)

Adds the specified extension to the collection of extensions.

public:
 virtual void Add(System::Object ^ singletonExtension);
public virtual void Add (object singletonExtension);
abstract member Add : obj -> unit
override this.Add : obj -> unit
Public Overridable Sub Add (singletonExtension As Object)

Parameters

singletonExtension
Object

The extension to add.

Remarks

When this overload is used, each workflow instance that requests this extension type will get the extension instance provided to this method. If each workflow instance should have its own instance of the extension, use the other Add overload.

If any of the Add overloads are called after MakeReadOnly, an InvalidOperationException is thrown.

Applies to

Add<T>(Func<T>)

Registers a Func<TResult> that is used to provide an instance of an extension when requested by a workflow instance.

public:
generic <typename T>
 where T : class virtual void Add(Func<T> ^ extensionCreationFunction);
public virtual void Add<T> (Func<T> extensionCreationFunction) where T : class;
abstract member Add : Func<'T (requires 'T : null)> -> unit (requires 'T : null)
override this.Add : Func<'T (requires 'T : null)> -> unit (requires 'T : null)
Public Overridable Sub Add(Of T As Class) (extensionCreationFunction As Func(Of T))

Type Parameters

T

The type of extension to add.

Parameters

extensionCreationFunction
Func<T>

The method that creates the extension.

Remarks

When this overload is used, each workflow instance that requests this extension type will get a new instance of the extension. If a singleton extension is desired, use the other Add overload.

If any of the Add overloads are called after MakeReadOnly, an InvalidOperationException is thrown.

Applies to