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

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

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

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

Variable<T>(String)

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

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)

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

Properties

Default

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

Modifiers

Gets or sets the VariableModifiers value for this Variable.

(Inherited from Variable)
Name

Gets or sets the name of the Variable.

(Inherited from Variable)
NameCore

Gets the name of the Variable.

(Inherited from Variable)
Type

Gets or sets the type of the LocationReference.

(Inherited from LocationReference)
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)

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

(Inherited from Object)
Get(ActivityContext)

Gets the value of the variable using the specified ActivityContext.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLocation(ActivityContext)

Returns the Location<T> of the variable.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Set(ActivityContext, Object)

Sets the value of the Variable using the specified ActivityContext.

(Inherited from Variable)
Set(ActivityContext, T)

Sets the value of the variable.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to