ReceiveReply 類別

定義

活動,這個活動會接受做為要求/回覆訊息交換模式一部分的訊息。An activity that receives a message as part of a request/reply message exchange pattern.

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

範例

下列範例將示範如何使用 ReceiveReply 活動。The following example shows how to use a ReceiveReply activity. 系統會建立 Send 活動並將它加入至 SequenceA Send activity is created and added to a Sequence. 然後,將 ReceiveReply 活動加入至 Sequence,以便接收來自 Send 活動的回覆。A ReceiveReply activity is then added to the Sequence to receive the reply from the Send activity.

static void CreateClientWorkflow()  
{  
   Variable<string> message = new Variable<string>("message", "Hello!");  
   Variable<string> result = new Variable<string> { Name = "result" };  
  
   Endpoint endpoint = new Endpoint  
   {  
      AddressUri = new Uri(Microsoft.Samples.WorkflowServicesSamples.Common.Constants.ServiceBaseAddress), Binding = new BasicHttpBinding(),  
   };  
  
   Send requestEcho = new Send  
   {  
      ServiceContractName = XName.Get("Echo", "http://tempuri.org/"),  
                Endpoint = endpoint,  
                OperationName = "Echo",  
      //parameters for send  
      Content = new SendParametersContent  
      {  
         Parameters =   
            {   
               { "message", new InArgument<string>(message) }  
            }  
        }  
    };  
    workflow = new CorrelationScope  
    {  
       Body = new Sequence  
       {  
          Variables = { message, result },  
                    Activities =  
                    {  
                        new WriteLine {  
                            Text = new InArgument<string>("Client is ready!")  
                        },  
                        requestEcho,  
  
                        new WriteLine {  
                            Text = new InArgument<string>("Message sent: Hello!")  
                        },  
  
                        new ReceiveReply  
                        {  
                            Request = requestEcho,  
                            //parameters for the reply  
                            Content = new ReceiveParametersContent                              
                            {  
                                Parameters =   
                                {  
                                    { "echo", new OutArgument<string>(result) }  
                                }  
                            }  
                        },                                                  
                        new WriteLine {  
                            Text = new InArgument<string>(env => "Message received: "+result.Get(env))  
                        }  
                    }  
                }  
            };  
        }  
  

建構函式

ReceiveReply()

初始化 ReceiveReply 類別的新執行個體。Initializes a new instance of the ReceiveReply class.

屬性

Action

取得或設定訊息動作標頭的值。Gets or sets the value of the action header of the message.

CacheId

取得工作流程定義範圍內的唯一快取識別碼。Gets the identifier of the cache that is unique within the scope of the workflow definition.

(繼承來源 Activity)
Constraints

取得 Constraint 活動的集合,這些活動可以設定為提供 Activity 的驗證。Gets a collection of Constraint activities that can be configured to provide validation for the Activity.

(繼承來源 Activity)
Content

取得或設定 ReceiveReply 活動接收的內容。Gets or sets the content received by the ReceiveReply activity.

CorrelationInitializers

取得相互關聯初始設定式的集合。Gets a collection of correlation initializers.

DisplayName

取得或設定選擇性的易記名稱,這個名稱會用於偵錯、驗證、例外狀況處理及追蹤。Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking.

(繼承來源 Activity)
Id

取得工作流程定義範圍內的唯一識別碼。Gets an identifier that is unique in the scope of the workflow definition.

(繼承來源 Activity)
Implementation

取得或設定委派,這個委派會傳回包含執行邏輯的 ActivityGets or sets the delegate that returns an Activity that contains the execution logic.

(繼承來源 Activity)
ImplementationVersion

取得或設定所使用實作的版本。Gets or sets the version of the implementation used.

(繼承來源 Activity)
Request

取得或設定與這個 Send 活動成對之 ReceiveReply 活動的參考。Gets or sets a reference to the Send activity paired with this ReceiveReply activity.

方法

CacheMetadata(ActivityMetadata)

建立並驗證活動引數、變數、子活動和活動委派的描述。Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates.

(繼承來源 Activity)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

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

建立動態更新對應時引發事件。Raises an event when creating dynamic update map.

(繼承來源 Activity)
ShouldSerializeDisplayName()

指出是否應序列化 DisplayName 屬性。Indicates whether the DisplayName property should be serialized.

(繼承來源 Activity)
ToString()

傳回包含 StringIdDisplayNameActivityReturns a String that contains the Id and DisplayName of the Activity.

(繼承來源 Activity)

適用於