InvokeMethod 類別

定義

呼叫指定之物件或型別的公用方法。Calls a public method of a specified object or type.

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

範例

下列程式碼範例將示範如何建立 InvokeMethod 活動。The following code sample demonstrates creating an InvokeMethod activity. 這個範例來自于使用 InvokeMethod 活動範例。This example is from the Using the InvokeMethod Activity sample.

new InvokeMethod
{
    TargetObject = new InArgument<TestClass>(ctx => testClass),
    MethodName = "InstanceMethod",
    Parameters =
    {
        new InArgument<string>("My favorite number is"),
        new InArgument<int>(42),
        new InArgument<string>("first item of the param array"),
        new InArgument<string>("second item of the param array"),
        new InArgument<string>("third item of the param array")
    }
},

建構函式

InvokeMethod()

建立 InvokeMethod 類別的新執行個體。Creates a new instance of the InvokeMethod class.

屬性

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)
DisplayName

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

(繼承來源 Activity)
GenericTypeArguments

所包含方法的泛型型別引數。The generic type arguments of the contained method.

Id

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

(繼承來源 Activity)
Implementation

在嘗試設定此屬性的值時,取得 null 或擲回錯誤。Gets null or throws an error when there is an attempt to set the value of this property.

(繼承來源 AsyncCodeActivity)
ImplementationVersion

取得或設定活動的實作版本。Gets or sets the implementation version of the activity.

(繼承來源 AsyncCodeActivity)
MethodName

活動執行時要叫用之方法的名稱。The name of the method to be invoked when the activity executes.

Parameters

要叫用之方法的參數集合。The parameter collection of the method to be invoked.

Result

方法作業的傳回值。The return value of the method operation.

RunAsynchronously

取得或設定值,此值指出是否要以非同步方式叫用活動的方法。Gets or sets a value that indicates whether the activity's method is invoked asynchronously.

TargetObject

包含要執行之方法的物件。The object that contains the method to execute.

TargetType

TargetObject 的類型。The type of the TargetObject.

方法

BeginExecute(AsyncCodeActivityContext, AsyncCallback, Object)

在衍生類別中實作及使用指定的執行內容、回呼方法和使用者狀態時,將非同步活動加入執行階段工作流程中的佇列。When implemented in a derived class and using the specified execution context, callback method, and user state, enqueues an asynchronous activity in a run-time workflow.

(繼承來源 AsyncCodeActivity)
CacheMetadata(ActivityMetadata)

未實作。Not implemented. 請改用 CacheMetadata(CodeActivityMetadata)Use CacheMetadata(CodeActivityMetadata) instead.

(繼承來源 AsyncCodeActivity)
CacheMetadata(CodeActivityMetadata)

做為虛擬方法,並轉換由非同步活動引數中快取反映取得的資料。Serves as a virtual method and converts information obtained by cache reflection into arguments for an asynchronous activity.

(繼承來源 AsyncCodeActivity)
Cancel(AsyncCodeActivityContext)

在衍生類別中實作及使用指定的執行環境資訊時,會通知工作流程執行階段非同步活動作業已提早完成。When implemented in a derived class and using the specified execution environment information, notifies the workflow runtime that the asynchronous activity operation has reached an early completion. 做為虛擬方法。Serves as a virtual method.

(繼承來源 AsyncCodeActivity)
EndExecute(AsyncCodeActivityContext, IAsyncResult)

在衍生類別中實作及使用指定的執行環境資訊時,會通知工作流程執行階段相關聯的非同步活動作業已完成。When implemented in a derived class and using the specified execution environment information, notifies the workflow runtime that the associated asynchronous activity operation has completed.

(繼承來源 AsyncCodeActivity)
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 a map for the dynamic update.

(繼承來源 AsyncCodeActivity)
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)

適用於