简体   繁体   English

Windows Workflow Foundation InvokeMethod类

[英]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. 下面是我在Microsoft-Windows-Workflow-4-0-cookbook中正在练习的一些代码片段。 I don't understand the lambda statement. 我不理解lambda声明。 What is aec in the following context (aec=>testClass). 在以下上下文中,什么是aec(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. WF应用程序使用ActivityContext类型来存储和检索活动参数数据,以及诸如书签和活动计划之类的其他内容。

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. 在内部,此模型可以带来许多内存管理方面的改进,因为只有一个活动类型的副本(如果在流中多次使用)将被保存在内存中,并且它们的状态由ActivityContext本身进行管理。 This allows for fancy things to be done, especially in persisting workflow instances without consuming more data. 这样就可以完成一些花哨的事情,尤其是在持久化工作流实例而无需消耗更多数据的情况下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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