This documentation is archived and is not being maintained.
Variable<T> Class
Visual Studio 2010
Represents a variable in a workflow.
System::Object
System.Activities::LocationReference
System.Activities::Variable
System.Activities::Variable<T>
System.Activities::LocationReference
System.Activities::Variable
System.Activities::Variable<T>
Assembly: System.Activities (in System.Activities.dll)
The Variable<T> type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | 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. |
| Name | Description | |
|---|---|---|
![]() | 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.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | Get | Gets the value of the variable using the specified ActivityContext. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLocation | 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.) |
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 } } };
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
