Variable<T> 類別

定義

代表工作流程中的變數。

generic <typename T>
public ref class Variable sealed : System::Activities::Variable
public sealed class Variable<T> : System.Activities.Variable
type Variable<'T> = class
    inherit Variable
Public NotInheritable Class Variable(Of T)
Inherits Variable

類型參數

T

TypeVariable<T>

繼承

範例

在這個範例中,Variable<T> 會用來保留訊息字串。 這個訊息會由 WriteLine 活動寫入至主控台視窗。

Variable<string> msg =   
    new Variable<string>() { Default = "Hello World!" };  

Activity wf = new Sequence()  
{  
    Variables =   
    {  
        msg  
    },  
    Activities =  
    {  
        new WriteLine()  
        {  
            Text = msg  
        }  
    }  
};  

建構函式

Variable<T>()

初始化 Variable<T> 類別的新執行個體。

Variable<T>(Expression<Func<ActivityContext,T>>)

使用預設運算式,初始化 Variable<T> 類別的新執行個體。

Variable<T>(String)

使用變數名稱,初始化 Variable<T> 類別的新執行個體。

Variable<T>(String, Expression<Func<ActivityContext,T>>)

使用變數名稱和預設運算式,初始化 Variable<T> 類別的新執行個體。

Variable<T>(String, T)

使用變數名稱和預設值,初始化 Variable<T> 類別的新執行個體。

屬性

Default

取得或設定表示這個 Activity<TResult> 之預設值的 Variable<T>

Modifiers

取得或設定這個 VariableModifiersVariable 值。

(繼承來源 Variable)
Name

取得或設定 Variable 的名稱。

(繼承來源 Variable)
NameCore

取得 Variable 的名稱。

(繼承來源 Variable)
Type

取得或設定 LocationReference 的型別。

(繼承來源 LocationReference)
TypeCore

在衍生類別中實作時,取得或設定 LocationReference 型別的當地語系化版本。

(繼承來源 LocationReference)

方法

Equals(Object)

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

(繼承來源 Object)
Get(ActivityContext)

使用指定的 ActivityContext 取得變數的值。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetLocation(ActivityContext)

傳回變數的 Location<T>

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
Set(ActivityContext, Object)

使用指定的 Variable 設定 ActivityContext 的值。

(繼承來源 Variable)
Set(ActivityContext, T)

設定變數的值。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於