![](/img/trans.png)
[英]C# 6.0 Approach to Checking if Local Variable or Object is Null (not a field) Using the Null-propagation Operator
[英]How to assign a variable in a workflow if InvokeMethod activity returns an object?
這是Visual Studio屬性中的解決方案:
首先向您的工作流程添加一個變量:
將InvokeMethod活動放入您的工作流工作區並編輯屬性:
這是XAMLX中的解決方案
xmlns:mca="clr-namespace:Microsoft.CSharp.Activities;assembly=System.Activities"
xmlns:p1="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
<p1:InvokeMethod sap2010:WorkflowViewState.IdRef="InvokeMethod_1" MethodName="YourMethodName" TargetType="x:Object">
<p1:InvokeMethod.Result>
<p1:OutArgument x:TypeArguments="x:Object">
<mca:CSharpReference x:TypeArguments="x:Object">workflowVariableName</mca:CSharpReference>
</p1:OutArgument>
</p1:InvokeMethod.Result>
<p1:InArgument x:TypeArguments="x:Int32">
<mca:CSharpValue x:TypeArguments="x:Int32">variableNamePassedToMyMethod;</mca:CSharpValue>
</p1:InArgument>
</p1:InvokeMethod>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.