Variable<T> Variable<T> Variable<T> Variable<T> Class

Definition

Represents a variable in a workflow.

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

Type Parameters

T

The Type of the Variable<T>.

Inheritance

Examples

In this example, a Variable<T> is used to hold a message string. This message is written to the console window by a WriteLine activity.

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

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

Constructors

Variable<T>() Variable<T>() Variable<T>() Variable<T>()

Initializes a new instance of the Variable<T> class.

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

Initializes a new instance of the Variable<T> class with the default expression.

Variable<T>(String) Variable<T>(String) Variable<T>(String) Variable<T>(String)

Initializes a new instance of the Variable<T> class with the variable name.

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

Initializes a new instance of the Variable<T> class with the variable name and default expression.

Variable<T>(String, T) Variable<T>(String, T) Variable<T>(String, T) Variable<T>(String, T)

Initializes a new instance of the Variable<T> class with the variable name and default value.

Properties

Default Default Default Default

Gets or sets the Activity<TResult> that represents the default value for this Variable<T>.

Modifiers Modifiers Modifiers Modifiers

Gets or sets the VariableModifiers value for this Variable.

(Inherited from Variable)
Name Name Name Name

Gets or sets the name of the Variable.

(Inherited from Variable)
NameCore NameCore NameCore NameCore

Gets the name of the Variable.

(Inherited from Variable)
Type Type Type Type

Gets or sets the type of the LocationReference.

(Inherited from LocationReference)
TypeCore TypeCore TypeCore TypeCore

When implemented in a derived class, gets or sets the culturally localized version of the type of the LocationReference.

(Inherited from LocationReference)

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Get(ActivityContext) Get(ActivityContext) Get(ActivityContext) Get(ActivityContext)

Gets the value of the variable using the specified ActivityContext.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLocation(ActivityContext) GetLocation(ActivityContext) GetLocation(ActivityContext) GetLocation(ActivityContext)

Returns the Location<T> of the variable.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Set(ActivityContext, Object) Set(ActivityContext, Object) Set(ActivityContext, Object) Set(ActivityContext, Object)

Sets the value of the Variable using the specified ActivityContext.

(Inherited from Variable)
Set(ActivityContext, T) Set(ActivityContext, T) Set(ActivityContext, T) Set(ActivityContext, T)

Sets the value of the variable.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to