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 );
|
|