Activity<TResult> 類別

定義

用來從既有 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>
衍生
屬性

範例

下列範例將示範如何從 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>()

在衍生類別中實作時,建立衍生類別的新執行個體。

屬性

CacheId

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

(繼承來源 Activity)
Constraints

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

(繼承來源 Activity)
DisplayName

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

(繼承來源 Activity)
Id

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

(繼承來源 Activity)
Implementation

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

(繼承來源 Activity)
ImplementationVersion

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

(繼承來源 Activity)
Result

取得或設定 Activity<TResult> 的結果引數。

ResultType

在衍生類別中實作時,取得活動 OutArgument 的型別。

(繼承來源 ActivityWithResult)

方法

CacheMetadata(ActivityMetadata)

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

(繼承來源 Activity)
Equals(Object)

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

(繼承來源 Object)
FromValue(TResult)

傳回會評估至指定值的 Activity<TResult> 運算式。

FromVariable(Variable)

傳回會評估至指定 Activity<TResult>Variable 運算式。

FromVariable(Variable<TResult>)

傳回會評估至指定 Activity<TResult>Variable<T> 運算式。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

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

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

(繼承來源 Activity)
ShouldSerializeDisplayName()

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

(繼承來源 Activity)
ToString()

傳回包含 的 和 的 。

(繼承來源 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> 運算式。

適用於