WorkflowCompletedEventArgs.OutputParameters 属性

定义

获取工作流的输出。

public:
 property System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ OutputParameters { System::Collections::Generic::Dictionary<System::String ^, System::Object ^> ^ get(); };
public System.Collections.Generic.Dictionary<string,object> OutputParameters { get; }
member this.OutputParameters : System.Collections.Generic.Dictionary<string, obj>
Public ReadOnly Property OutputParameters As Dictionary(Of String, Object)

属性值

值的 Dictionary<TKey,TValue>,它由包含工作流的输出参数的参数名称进行键控。

示例

下面的代码示例演示如何从存储在 OutputParameters 属性中的键获取值。 OnWorkflowCompleted 方法具有一个采用 WorkflowCompletedEventArgs 的参数。 此方法在引发 WorkflowCompleted 事件时调用。 该代码使用 OutputParameters 属性来获取与 Status 键关联的值并将其写入控制台。

此代码示例摘自 Program.cs 文件中的“带有参数的顺序工作流”SDK 示例。 有关详细信息,请参阅 包含参数的工作流示例

static void OnWorkflowCompleted(object sender, WorkflowCompletedEventArgs e)
{
    //The order status is stored in the "status" "out" parameter
    string orderStatus = e.OutputParameters["Status"].ToString();
    Console.WriteLine("Order was " + orderStatus);
    waitHandle.Set();
}
Shared Sub OnWorkflowCompleted(ByVal sender As Object, ByVal e As WorkflowCompletedEventArgs)

    'The order status is stored in the "status" "out" parameter
    Dim orderStatus As String = e.OutputParameters("Status").ToString()
    Console.WriteLine("Order was " + orderStatus)
    waitHandle.Set()
End Sub

注解

OutputParameters 包含工作流的 outref 参数。

适用于

另请参阅