InOutArgument(T) Class
TOC
Collapse the table of content
Expand the table of content

InOutArgument<T> Class

.NET Framework (current version)
 

A binding terminal that represents the flow of data into and out of an activity.

Namespace:   System.Activities
Assembly:  System.Activities (in System.Activities.dll)

System.Object
  System.Activities.Argument
    System.Activities.InOutArgument
      System.Activities.InOutArgument<T>

[ContentPropertyAttribute("Expression")]
[TypeConverterAttribute(typeof(InOutArgumentConverter))]
public sealed class InOutArgument<T> : InOutArgument

Type Parameters

T

The data type of the InOutArgument<T>.

NameDescription
System_CAPS_pubmethodInOutArgument<T>()

Initializes a new instance of the InOutArgument<T> class using default values.

System_CAPS_pubmethodInOutArgument<T>(Activity<Location<T>>)

Initializes a new instance of the InOutArgument<T> class using the specified Activity<TResult>.

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

Initializes a new instance of the InOutArgument<T> class using the specified expression.

System_CAPS_pubmethodInOutArgument<T>(Variable)

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

System_CAPS_pubmethodInOutArgument<T>(Variable<T>)

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

NameDescription
System_CAPS_pubpropertyArgumentType

Gets the data type for the data bound to this Argument.(Inherited from Argument.)

System_CAPS_pubpropertyDirection

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

System_CAPS_pubpropertyEvaluationOrder

Gets or sets a zero-based value that specifies the order in which the argument is evaluated.(Inherited from Argument.)

System_CAPS_pubpropertyExpression

Gets an Activity<TResult> that represents the value of this InOutArgument<T>.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticFromExpression(Activity<Location<T>>)

Initializes and returns a new InOutArgument<T> constructed using the specified Activity<TResult>.

System_CAPS_pubmethodSystem_CAPS_staticFromVariable(Variable<T>)

Initializes and returns a new InOutArgument<T> constructed by using the specified Variable<T>.

System_CAPS_pubmethodGet(ActivityContext)

Gets the value of the InOutArgument<T> using the specified ActivityContext.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLocation(ActivityContext)

Gets the location of the value for the InOutArgument<T>.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSet(ActivityContext, T)

Sets the value of the argument using the specified value.

System_CAPS_pubmethodSet(ActivityContext, Object)

Sets the value of the argument using the specified activity context.(Inherited from Argument.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_puboperatorSystem_CAPS_staticImplicit(Activity<Location<T>> to InOutArgument<T>)

Initializes and returns a new InOutArgument<T> constructed using the specified Activity<TResult>.

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

.NET Framework
Available since 4.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft