Compartilhar via


TransactedReceiveScope.Variables Propriedade

Definição

Obtém a coleção de Variable associado a esta TransactedReceiveScope.

public:
 property System::Collections::ObjectModel::Collection<System::Activities::Variable ^> ^ Variables { System::Collections::ObjectModel::Collection<System::Activities::Variable ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.Activities.Variable> Variables { get; }
member this.Variables : System.Collections.ObjectModel.Collection<System.Activities.Variable>
Public ReadOnly Property Variables As Collection(Of Variable)

Valor da propriedade

As variáveis associadas ao escopo de recebimento transacionado.

Exemplos

O exemplo a seguir mostra como definir a Variables propriedade .

return new Sequence
{
    Activities = 
    {
        new WriteLine { Text = "Service workflow begins." },

        new System.ServiceModel.Activities.TransactedReceiveScope
        {
            Variables = { requestMessage, replyMessage },
            Request = receive,
            Body = new Sequence
            {
                Activities =
                {
                    new WriteLine { Text = new InArgument<string>("Server side: Receive complete.") },
                    
                    new WriteLine { Text = new InArgument<string>(new VisualBasicValue<string>() { ExpressionText = "\"Server side: Received = '\" + requestString.toString() + \"'\"" }) },

                    new PrintTransactionInfo(),

                    new Assign<string>
                    {
                        Value = new InArgument<string>("Server side: Sending reply."),
                        To = new OutArgument<string>(replyMessage)
                    },

                    new WriteLine { Text = new InArgument<string>("Server side: Begin reply.") },

                    new SendReply
                    {
                        Request = receive,
                        Content = SendContent.Create(new InArgument<string>(replyMessage)),                                    
                    },

                    new WriteLine { Text = new InArgument<string>("Server side: Reply sent.") },
                },
            },
        },

        new WriteLine { Text = "Server workflow ends." },
    },
};

Aplica-se a