Activity<TResult> 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用來從既有 Activity 物件建立複合活動的抽象基底類別,這個類別會使用活動的類型規範來指定結果類型。
generic <typename TResult>
public ref class Activity abstract : System::Activities::ActivityWithResult
[System.ComponentModel.TypeConverter(typeof(System.Activities.XamlIntegration.ActivityWithResultConverter))]
public abstract class Activity<TResult> : System.Activities.ActivityWithResult
[<System.ComponentModel.TypeConverter(typeof(System.Activities.XamlIntegration.ActivityWithResultConverter))>]
type Activity<'Result> = class
inherit ActivityWithResult
Public MustInherit Class Activity(Of TResult)
Inherits ActivityWithResult
- TResult
活動之傳回值的型別。
- 繼承
- 衍生
- 屬性
下列範例將示範如何從 Activity<TResult> 衍生類別。
public sealed class AppendString : Activity<string>
{
// Input argument.
[RequiredArgument]
public InArgument<string> Name { get; set; }
public AppendString()
{
// Define the implementation of this activity.
this.Implementation = () => new Assign<string>
{
Value = new LambdaValue<string>(ctx => Name.Get(ctx) + " says hello world"),
To = new LambdaReference<string>(ctx => Result.Get(ctx)),
};
}
}
Activity<TResult> 是活動型別階層中的基底類別。 具有泛型型別定義的所有其他活動型別 (例如 CodeActivity<TResult>、NativeActivity<TResult>、AsyncCodeActivity<TResult> 和 DynamicActivity<TResult>) 會衍生自這個類別。
Activity<TResult>() |
在衍生類別中實作時,建立衍生類別的新執行個體。 |
Cache |
取得工作流程定義範圍內的唯一快取識別碼。 (繼承來源 Activity) |
Constraints |
取得 Constraint 活動的集合,這些活動可以設定為提供 Activity 的驗證。 (繼承來源 Activity) |
Display |
取得或設定選擇性的易記名稱,這個名稱會用於偵錯、驗證、例外狀況處理及追蹤。 (繼承來源 Activity) |
Id |
取得工作流程定義範圍內的唯一識別碼。 (繼承來源 Activity) |
Implementation |
取得或設定委派,這個委派會傳回包含執行邏輯的 Activity。 (繼承來源 Activity) |
Implementation |
取得或設定所使用實作的版本。 (繼承來源 Activity) |
Result |
取得或設定 Activity<TResult> 的結果引數。 |
Result |
在衍生類別中實作時,取得活動 OutArgument 的型別。 (繼承來源 ActivityWithResult) |
Cache |
建立並驗證活動引數、變數、子活動和活動委派的描述。 (繼承來源 Activity) |
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
From |
傳回會評估至指定值的 Activity<TResult> 運算式。 |
From |
傳回會評估至指定 Activity<TResult> 的 Variable 運算式。 |
From |
傳回會評估至指定 Activity<TResult> 的 Variable<T> 運算式。 |
Get |
做為預設雜湊函式。 (繼承來源 Object) |
Get |
取得目前執行個體的 Type。 (繼承來源 Object) |
Memberwise |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
On |
建立動態更新對應時引發事件。 (繼承來源 Activity) |
Should |
指出是否應序列化 DisplayName 屬性。 (繼承來源 Activity) |
To |
傳回包含 的 和 的 。 (繼承來源 Activity) |
Implicit(TResult to Activity<TResult>) |
傳回會評估至指定值的 Activity<TResult> 運算式。 |
Implicit(Variable to Activity<TResult>) |
傳回會評估至指定 Activity<TResult> 的 Variable 運算式。 |
Implicit(Variable<TResult> to Activity<TResult>) |
傳回會評估至指定 Activity<TResult> 的 Variable<T> 運算式。 |
產品 | 版本 |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |