Delay Classe
Definição
Cria um temporizador para um período especificado, usando uma TimerExtension.Creates a timer for a specified duration, using a TimerExtension.
public ref class Delay sealed : System::Activities::NativeActivity
[System.Windows.Markup.ContentProperty("Duration")]
public sealed class Delay : System.Activities.NativeActivity
[<System.Windows.Markup.ContentProperty("Duration")>]
type Delay = class
inherit NativeActivity
Public NotInheritable Class Delay
Inherits NativeActivity
- Herança
- Atributos
Exemplos
O exemplo de código a seguir demonstra como criar uma Delay atividade.The following code sample demonstrates creating a Delay activity. Este exemplo é do uso da amostra de atividade de seleção .This example is from the Using the Pick Activity sample.
static Activity CreateWF()
{
Variable<string> name = new Variable<string>();
Sequence body = new Sequence
{
Variables = { name },
Activities =
{
new WriteLine { Text = "What is your name? (You have 5 seconds to answer)" },
new Pick
{
Branches =
{
new PickBranch
{
Trigger = new ReadString
{
Result = name,
BookmarkName = bookmarkName
},
Action = new WriteLine
{
Text = new InArgument<string>(env => "Hello " + name.Get(env))
}
},
new PickBranch
{
Trigger = new Delay
{
Duration = TimeSpan.FromSeconds(5)
},
Action = new WriteLine
{
Text = "Time is up."
}
}
}
}
}
};
return body;
}
Comentários
Quando o temporizador da atividade expira, a Delay atividade conclui sua execução.When the activity's timer expires, the Delay activity completes its execution.
Construtores
| Delay() |
Cria uma nova instância da atividade Delay.Creates a new instance of the Delay activity. |
Propriedades
| CacheId |
Obtém um identificador do cache que é exclusivo no escopo da definição do fluxo de trabalho.Gets the identifier of the cache that is unique within the scope of the workflow definition. (Herdado de Activity) |
| CanInduceIdle |
Obtém ou define um valor que indica se a atividade pode fazer com que o fluxo de trabalho fique ocioso.Gets or sets a value that indicates whether the activity can cause the workflow to become idle. (Herdado de NativeActivity) |
| Constraints |
Obtém uma coleção de atividades de Constraint que podem ser configuradas para fornecer validação para a Activity.Gets a collection of Constraint activities that can be configured to provide validation for the Activity. (Herdado de Activity) |
| DisplayName |
Obtém ou define um nome amigável opcional que é usado para depuração, validação, manipulação de exceções e acompanhamento.Gets or sets an optional friendly name that is used for debugging, validation, exception handling, and tracking. (Herdado de Activity) |
| Duration |
A duração do temporizador que a atividade Delay cria.The duration of the timer that the Delay activity creates. Se a duração for definida como MaxValue, o atraso será infinito.If the duration is set to MaxValue, the delay is infinite. |
| Id |
Obtém um identificador que é exclusivo no escopo da definição do fluxo de trabalho.Gets an identifier that is unique in the scope of the workflow definition. (Herdado de Activity) |
| Implementation |
A lógica de execução da atividade.The execution logic of the activity. (Herdado de NativeActivity) |
| ImplementationVersion |
Obtém ou define a versão de implementação da atividade.Gets or sets the implementation version of the activity. (Herdado de NativeActivity) |
Métodos
| Abort(NativeActivityAbortContext) |
Quando implementado em uma classe derivada, executa ações em resposta à atividade que está sendo anulada.When implemented in a derived class, takes actions in response to the activity being aborted. (Herdado de NativeActivity) |
| CacheMetadata(ActivityMetadata) |
Não implementado.Not implemented. Use o método CacheMetadata(NativeActivityMetadata) em seu lugar.Use the CacheMetadata(NativeActivityMetadata) method instead. (Herdado de NativeActivity) |
| CacheMetadata(NativeActivityMetadata) |
Cria e valida uma descrição dos argumentos, das variáveis, das atividades filho e dos representantes da atividade.Creates and validates a description of the activity's arguments, variables, child activities, and activity delegates. (Herdado de NativeActivity) |
| Cancel(NativeActivityContext) |
Quando implementado em uma classe derivada, executa a lógica para causar a conclusão antecipada normal da atividade.When implemented in a derived class, runs logic to cause graceful early completion of the activity. (Herdado de NativeActivity) |
| 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) |
| Execute(NativeActivityContext) |
Quando implementado em uma classe derivada, executa a lógica de execução da atividade.When implemented in a derived class, runs the activity's execution logic. (Herdado de NativeActivity) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| 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) |
| OnCreateDynamicUpdateMap(NativeActivityUpdateMapMetadata, Activity) |
Gera um evento durante a criação de um mapa para a atualização dinâmica.Raises an event when creating a map for the dynamic update. (Herdado de NativeActivity) |
| OnCreateDynamicUpdateMap(UpdateMapMetadata, Activity) |
Gera um evento durante a criação de um mapa para a atualização dinâmica.Raises an event when creating a map for the dynamic update. (Herdado de NativeActivity) |
| ShouldSerializeDisplayName() |
Indica se a propriedade DisplayName deve ser serializada.Indicates whether the DisplayName property should be serialized. (Herdado de Activity) |
| ToString() |
Retorna um String que contém o Id e DisplayName do Activity.Returns a String that contains the Id and DisplayName of the Activity. (Herdado de Activity) |
| UpdateInstance(NativeActivityUpdateContext) |
Atualiza a instância da NativeActivity.Updates the instance of NativeActivity. (Herdado de NativeActivity) |