Redigera

Dela via


OutArgument<T> Constructors

Definition

Initialize a new instance of the OutArgument<T> class.

Overloads

OutArgument<T>()

Initialize a new instance of the OutArgument<T> class using default values.

OutArgument<T>(Activity<Location<T>>)

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

OutArgument<T>(DelegateArgument)

Initializes a new instance of the OutArgument<T> class using the specified DelegateArgument.

OutArgument<T>(Variable)

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

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

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

OutArgument<T>()

Initialize a new instance of the OutArgument<T> class using default values.

public:
 OutArgument();
public OutArgument ();
Public Sub New ()

Examples

The following code sample demonstrates creating an OutArgument<T>. This example is from the Formatter sample.

Sequence workflow = new Sequence
{
    Variables = { mealExpense, result },
    Activities =
        {
            new Assign<Expense>
            {
               Value = new InArgument<Expense>( (e) => new Meal { Amount = 50, Location = "Redmond", Vendor = "KFC" }),
               To = new OutArgument<Expense>(mealExpense)
            },
            new WriteLine
            {
                Text = new InArgument<string>("Hello")
            },
            approveExpense,
            new ReceiveReply
            {
                Request = approveExpense,
                Content = ReceiveContent.Create(new OutArgument<bool>(result))
            },

            new If
            {
               Condition = new InArgument<bool> (result),
               Then =
                    new WriteLine
                    {
                        Text = new InArgument<string>("Expense Approved")
                    },
               Else =
                    new WriteLine
                    {
                        Text = new InArgument<string>("Expense Cannot be Approved")
                    },
            },
        }
};

Applies to

OutArgument<T>(Activity<Location<T>>)

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

public:
 OutArgument(System::Activities::Activity<System::Activities::Location<T> ^> ^ expression);
public OutArgument (System.Activities.Activity<System.Activities.Location<T>> expression);
new System.Activities.OutArgument<'T> : System.Activities.Activity<System.Activities.Location<'T>> -> System.Activities.OutArgument<'T>
Public Sub New (expression As Activity(Of Location(Of T)))

Parameters

expression
Activity<Location<T>>

The value of the argument.

Applies to

OutArgument<T>(DelegateArgument)

Initializes a new instance of the OutArgument<T> class using the specified DelegateArgument.

public:
 OutArgument(System::Activities::DelegateArgument ^ delegateArgument);
public OutArgument (System.Activities.DelegateArgument delegateArgument);
new System.Activities.OutArgument<'T> : System.Activities.DelegateArgument -> System.Activities.OutArgument<'T>
Public Sub New (delegateArgument As DelegateArgument)

Parameters

delegateArgument
DelegateArgument

The value of the argument.

Applies to

OutArgument<T>(Variable)

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

public:
 OutArgument(System::Activities::Variable ^ variable);
public OutArgument (System.Activities.Variable variable);
new System.Activities.OutArgument<'T> : System.Activities.Variable -> System.Activities.OutArgument<'T>
Public Sub New (variable As Variable)

Parameters

variable
Variable

The value of the argument.

Applies to

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

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

public:
 OutArgument(System::Linq::Expressions::Expression<Func<System::Activities::ActivityContext ^, T> ^> ^ expression);
public OutArgument (System.Linq.Expressions.Expression<Func<System.Activities.ActivityContext,T>> expression);
new System.Activities.OutArgument<'T> : System.Linq.Expressions.Expression<Func<System.Activities.ActivityContext, 'T>> -> System.Activities.OutArgument<'T>
Public Sub New (expression As Expression(Of Func(Of ActivityContext, T)))

Parameters

expression
Expression<Func<ActivityContext,T>>

The value of the argument.

Applies to