简体   繁体   中英

Windows Workflow Foundation InvokeMethod class

below I have some code snippet from a exercise I'm working through in Microsoft-Windows-Workflow-4-0-cookbook. I don't understand the lambda statement. What is aec in the following context (aec=>testClass). The tool tip states that is a activity context. What is it purpose?

    TestClass testClass = new TestClass();
    Variable<string> resultValue = new Variable<string>();

    return new Sequence()
    {
        Variables = { resultValue },
        Activities = {
            new WriteLine() {Text = "... Invoke void Method()"},
            new InvokeMethod() { TargetObject = new InArgument<TestClass> (aec=>testClass),
                MethodName = "Method", },

WF applications use the ActivityContext type for storing and retrieving activity argument data, as well as other things such as bookmarks and activity scheduling.

Internally, this model can end up with many memory management improvements since only one copy of an activity type (if used more than once in a flow), will be in memory, and their states are managed by the ActivityContext itself. This allows for fancy things to be done, especially in persisting workflow instances without consuming more data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM