InOutArgument<T> Class
A binding terminal that represents the flow of data into and out of an activity.
System.Activities::Argument
System.Activities::InOutArgument
System.Activities::InOutArgument<T>
Assembly: System.Activities (in System.Activities.dll)
The InOutArgument<T> type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | InOutArgument<T>() | Initializes a new instance of the InOutArgument<T> class using default values. |
![]() | InOutArgument<T>(Activity<Location<T>>) | Initializes a new instance of the InOutArgument<T> class using the specified Activity<TResult>. |
![]() | InOutArgument<T>(Expression<Func<ActivityContext, T>>) | Initializes a new instance of the InOutArgument<T> class using the specified expression. |
![]() | InOutArgument<T>(Variable) | Initializes a new instance of the InOutArgument<T> class using the specified Variable. |
![]() | InOutArgument<T>(Variable<T>) | Initializes a new instance of the InOutArgument<T> class using the specified Variable<T>. |
| Name | Description | |
|---|---|---|
![]() | ArgumentType | Gets the data type for the data bound to this Argument. (Inherited from Argument.) |
![]() | Direction | Gets an ArgumentDirection that specifies whether the Argument represents the flow of data into an activity, out of an activity, or both into and out of an activity. (Inherited from Argument.) |
![]() | EvaluationOrder | Gets or sets a zero-based value that specifies the order in which the argument is evaluated. (Inherited from Argument.) |
![]() | Expression | Gets an Activity<TResult> that represents the value of this InOutArgument<T>. |
| 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.) |
![]() ![]() | FromExpression | Initializes and returns a new InOutArgument<T> constructed using the specified Activity<TResult>. |
![]() ![]() | FromVariable | Initializes and returns a new InOutArgument<T> constructed by using the specified Variable<T>. |
![]() | Get | Gets the value of the InOutArgument<T> using the specified ActivityContext. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLocation | Gets the location of the value for the InOutArgument<T>. |
![]() | 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 argument using the specified activity context. (Inherited from Argument.) |
![]() | Set(ActivityContext, T) | Sets the value of the argument using the specified value. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | Implicit(Activity<Location<T>> to InOutArgument<T>) | Initializes and returns a new InOutArgument<T> constructed using the specified Activity<TResult>. |
![]() ![]() | Implicit(Variable<T> to InOutArgument<T>) | Initializes and returns a new InOutArgument<T> constructed using the specified Variable<T>. |
In this example, a custom Square activity has an InOutArgument<T> of type Int32 named N1. This argument is used to receive the value to be operated on and is also used to pass the result of the operation back out.
class Square : CodeActivity { public Square() : base() { } public InOutArgument<int> N1 { get; set; } protected override void Execute(CodeActivityContext context) { context.SetValue<int>(N1, N1.Get(context) * N1.Get(context)); } }
In the following example, the Square activity is hosted in a workflow. A value is passed into the activity and the result is then displayed to the console window by a WriteLine activity.
Variable<int> n1 = new Variable<int>() { Default = 25 }; Activity activity1 = new Sequence() { Variables = { n1 }, Activities = { new Square() { N1 = new InOutArgument<int>(n1) }, new WriteLine() { Text = new InArgument<string>(ctx => "Squared result: " + n1.Get(ctx)) } } }; WorkflowInvoker.Invoke(activity1);
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.
