WF4.0 BASICS (25) ActivityAction and InvokeAction

Source: Internet
Author: User

 

 

Download example:

Http://files.cnblogs.com/foundation/ActivityActionSample.rar

 

ActivityAction

 

Class Name

System. Activities. ActivityAction

System. Activities. ActivityAction <T>

System. Activities. ActivityAction <T1, T2>

System. Activities. ActivityAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>

File

System. Activities. dll

Structure Description

System. Activities. ActivityDelegate

Is a sealed class

The [DisplayName] attribute is of the [string] type and is a set of parallel branches.

The [Handler] attribute is of the [System. Activities. Activity] type and is the Activity to be executed.

[Argument, Argument1, Argument2, Argument16] the attribute type is [System. Activities. DelegateInArgument <T>], used to pass Parameters

Function Description

ActivityAction, ActivityAction <T,> used together with the InvokeAction, InvokeAction <T,> activity in the process

 

 

 

 

InvokeAction

Class Name

System. Activities. Statements. InvokeAction

System. Activities. Statements. InvokeAction <T>

System. Activities. Statements. InvokeAction <T1, T2>

System. Activities. Statements. InvokeAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>

File

System. Activities. dll

Structure Description

Inherit NativeActivity

Is a sealed class

Override [CacheMetadata method] and [Execute method] and [Cancel method]

[Action] The property type is [System. Activities. ActivityAction, ActivityAction <T,>], which is the ActivityAction to be called.

[Argument, Argument1, Argument2, Argument16] attribute type: [System. Activities. InArgument <T>], used to pass Parameters

Function Description

ActivityAction, ActivityAction <T,> used together with the InvokeAction, InvokeAction <T,> activity in the process

 

 

 

Instructions for use

ActivityAction, ActivityAction <T,> is not added to the toolbar by default. You must manually add

 

 

 

 

Example
To implement the following functions:

Define a string variable [myVariable] in the process

Define an ActivityAction attribute parameter [myAction] in the process.

Add a [ActivityAction <T>] in the process. This activity will pass [myVariable] into [myAction] and call [myAction].

 

The specific content of [myAction] is specified during the creation process.

 

 

Process

 

Bind it to [InvokeAction] to bind the [myAction] To be executed. This step must be performed in the XAML file.

 

<InvokeAction
X: TypeArguments = "x: String"
Argument = "[myVariable]"
Sap: VirtualizedContainerService. HintSize = "">

 

<PropertyReference
X: TypeArguments = "ActivityAction (x: String )"
PropertyName = "myAction"/>

 

</InvokeAction>

 

Host

 


TestWorkflow = new
TestWorkflow ();

 


ActivityAction <string> activityAction = new
ActivityAction <string> ();

 

ActivityAction. Argument = new
DelegateInArgument <string> ();

ActivityAction. Handler = new
WriteLine () {Text = activityAction. Argument };

 

TestWorkflow. myAction = activityAction;

 


WorkflowInvoker. Invoke (testWorkflow );

 


 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.