Variable<T> Classe

Definição

Representa uma variável em um fluxo de trabalho.Represents a variable in a workflow.

generic <typename T>
public ref class Variable sealed : System::Activities::Variable
public sealed class Variable<T> : System.Activities.Variable
type Variable<'T> = class
    inherit Variable
Public NotInheritable Class Variable(Of T)
Inherits Variable

Parâmetros de tipo

T

O Type do Variable<T>.The Type of the Variable<T>.

Herança

Exemplos

Neste exemplo, um Variable<T> é usado para manter uma cadeia de caracteres de mensagem.In this example, a Variable<T> is used to hold a message string. Essa mensagem é gravada na janela do console por uma WriteLine atividade.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  
        }  
    }  
};  

Construtores

Variable<T>()

Inicializa uma nova instância da classe Variable<T>.Initializes a new instance of the Variable<T> class.

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

Inicializa uma nova instância da classe Variable<T> com a expressão padrão.Initializes a new instance of the Variable<T> class with the default expression.

Variable<T>(String)

Inicializa uma nova instância da classe Variable<T> com o nome da variável.Initializes a new instance of the Variable<T> class with the variable name.

Variable<T>(String, Expression<Func<ActivityContext,T>>)

Inicializa uma nova instância da classe Variable<T> com o nome da variável e a expressão padrão.Initializes a new instance of the Variable<T> class with the variable name and default expression.

Variable<T>(String, T)

Inicializa uma nova instância da classe Variable<T> com o nome da variável e o valor padrão.Initializes a new instance of the Variable<T> class with the variable name and default value.

Propriedades

Default

Obtém ou define o Activity<TResult> que representa o valor padrão desta Variable<T>.Gets or sets the Activity<TResult> that represents the default value for this Variable<T>.

Modifiers

Obtém ou define o valor de VariableModifiers para esta Variable.Gets or sets the VariableModifiers value for this Variable.

(Herdado de Variable)
Name

Obtém ou define o nome de Variable.Gets or sets the name of the Variable.

(Herdado de Variable)
NameCore

Obtém o nome da Variable.Gets the name of the Variable.

(Herdado de Variable)
Type

Obtém ou define o tipo de LocationReference.Gets or sets the type of the LocationReference.

(Herdado de LocationReference)
TypeCore

Quando implementada em uma classe derivada, obtém ou define a versão localizada culturalmente do tipo do LocationReference.When implemented in a derived class, gets or sets the culturally localized version of the type of the LocationReference.

(Herdado de LocationReference)

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
Get(ActivityContext)

Obtém o valor da variável usando o ActivityContext especificado.Gets the value of the variable using the specified ActivityContext.

GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetLocation(ActivityContext)

Retorna o Location<T> da variável.Returns the Location<T> of the variable.

GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
Set(ActivityContext, Object)

Define o valor da Variable usando o ActivityContext especificado.Sets the value of the Variable using the specified ActivityContext.

(Herdado de Variable)
Set(ActivityContext, T)

Define o valor da variável.Sets the value of the variable.

ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)

Aplica-se a