SendReply 類別

定義

傳送服務端上做為要求/回應訊息交換模式一部分之訊息的活動。

public ref class SendReply sealed : System::Activities::Activity
[System.Windows.Markup.ContentProperty("Content")]
public sealed class SendReply : System.Activities.Activity
[<System.Windows.Markup.ContentProperty("Content")>]
type SendReply = class
    inherit Activity
Public NotInheritable Class SendReply
Inherits Activity
繼承
SendReply
屬性

範例

下列範例將示範如何建立 SendReply 活動並以程式碼的形式,將它加入至工作流程。

Variable<string> message = new Variable<string> { Name = "message" };
Variable<string> echo = new Variable<string> { Name = "echo" };
Receive receiveString = new Receive
{
    OperationName = "Echo",
    ServiceContractName = "Echo",
    CanCreateInstance = true,
    //parameters for receive
    Content = new ReceiveParametersContent
    {
        Parameters = 
        {
            {"message", new OutArgument<string>(message)}
        }
    }
};

Sequence workflow = new Sequence()
{
    Variables = { message, echo },
    Activities =
        {
            receiveString,
            new WriteLine
            {
                Text = new InArgument<string>(env =>("Message received: " + message.Get(env)))
            },
            new Assign<string>
            {
                Value = new InArgument<string>(env =>("<echo> " + message.Get(env))),
                To = new OutArgument<string>(echo)
            },                        
            //parameters for reply
            new SendReply
            {                           
                Request = receiveString,                            
                Content = new SendParametersContent
                {
                    Parameters =
                    {
                        { "echo", new InArgument<string>(echo) }
                    },
                }
            },
            new WriteLine
            {
                Text = new InArgument<string>(env =>("Message sent: " + echo.Get(env)))
            },
        },
};

service = new WorkflowService
{
    Name = "Echo",
    Body = workflow
};

下列範例將示範如何建立 SendReply 活動並以 XAML 的形式,將它加入至工作流程服務。

<WorkflowService mc:Ignorable="sap" ConfigurationName="Service1" Name="Service1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/servicemodel" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=System.Xml" xmlns:s3="clr-namespace:System;assembly=System.Core" xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:ssa="clr-namespace:System.ServiceModel.Activities;assembly=System.ServiceModel.Activities" xmlns:st="clr-namespace:System.Text;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">  
  <p:Sequence sad:XamlDebuggerXmlReader.FileName="c:\Projects\WFServiceSnippets\WFServiceSnippets\Service1.xamlx" sap:VirtualizedContainerService.HintSize="277,644" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">  
    <p:Sequence.Variables>  
      <p:Variable x:TypeArguments="CorrelationHandle" Name="__handle1" />  
      <p:Variable x:TypeArguments="x:String" Name="Message" />  
      <p:Variable x:TypeArguments="x:String" Name="Echo" />  
    </p:Sequence.Variables>  
    <sap:WorkflowViewStateService.ViewState>  
      <scg3:Dictionary x:TypeArguments="x:String, x:Object">  
        <x:Boolean x:Key="IsExpanded">True</x:Boolean>  
      </scg3:Dictionary>  
    </sap:WorkflowViewStateService.ViewState>  
    <Receive x:Name="__ReferenceID0" CanCreateInstance="True" DisplayName="ReceiveString" sap:VirtualizedContainerService.HintSize="255,90" OperationName="Echo" ServiceContractName="Echo">  
      <Receive.CorrelationInitializers>  
        <RequestReplyCorrelationInitializer CorrelationHandle="[__handle1]" />  
      </Receive.CorrelationInitializers>  
      <ReceiveParametersContent>  
        <p:OutArgument x:TypeArguments="x:String" x:Key="message">[Message]</p:OutArgument>  
      </ReceiveParametersContent>  
    </Receive>  
    <p:WriteLine sap:VirtualizedContainerService.HintSize="255,61" Text="[&quot;Message received: &quot; + Message]" />  
    <p:Assign sap:VirtualizedContainerService.HintSize="255,58">  
      <p:Assign.To>  
        <p:OutArgument x:TypeArguments="x:String">[Echo]</p:OutArgument>  
      </p:Assign.To>  
      <p:Assign.Value>  
        <p:InArgument x:TypeArguments="x:String">["<echo> " + Message]</p:InArgument>  
      </p:Assign.Value>  
    </p:Assign>  
    <SendReply Request="{x:Reference __ReferenceID0}" DisplayName="SendReply" sap:VirtualizedContainerService.HintSize="255,90">  
      <SendParametersContent>  
        <p:InArgument x:TypeArguments="x:String" x:Key="echo">[Echo]</p:InArgument>  
      </SendParametersContent>  
    </SendReply>  
    <p:WriteLine sap:VirtualizedContainerService.HintSize="255,61" Text="[&quot;Message sent: &quot; + Echo]" />  
  </p:Sequence>  
</WorkflowService>  

建構函式

SendReply()

初始化 SendReply 類別的新執行個體。

屬性

Action

取得或設定訊息動作標頭的值。

CacheId

取得工作流程定義範圍內的唯一快取識別碼。

(繼承來源 Activity)
Constraints

取得 Constraint 活動的集合,這些活動可以設定為提供 Activity 的驗證。

(繼承來源 Activity)
Content

取得或設定 SendReply 活動所傳送的內容。

CorrelationInitializers

取得相互關聯初始設定式的集合。

DisplayName

取得或設定選擇性的易記名稱,這個名稱會用於偵錯、驗證、例外狀況處理及追蹤。

(繼承來源 Activity)
Id

取得工作流程定義範圍內的唯一識別碼。

(繼承來源 Activity)
Implementation

取得或設定委派,這個委派會傳回包含執行邏輯的 Activity

(繼承來源 Activity)
ImplementationVersion

取得或設定所使用實作的版本。

(繼承來源 Activity)
PersistBeforeSend

取得或設定值,這個值會指定傳送訊息前是否要保存工作流程服務執行個體。

Request

取得或設定與這個 Receive 活動成對之 SendReply 活動的參考。

方法

CacheMetadata(ActivityMetadata)

建立並驗證活動引數、變數、子活動和活動委派的描述。

(繼承來源 Activity)
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
FromOperationDescription(OperationDescription, IEnumerable<SendReply>)

傳回從指定合約作業描述的傳送回覆活動。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity)

建立動態更新對應時引發事件。

(繼承來源 Activity)
ShouldSerializeDisplayName()

指出是否應序列化 DisplayName 屬性。

(繼承來源 Activity)
ToString()

傳回包含 的 和 的 。

(繼承來源 Activity)

適用於