This API is now obsolete.
Provides the logic to establish a timer and to wait, asynchronously, for timer's expiration. This class cannot be inherited.
public ref class DelayActivity sealed : System::Workflow::ComponentModel::Activity, System::Workflow::Activities::IEventActivity, System::Workflow::ComponentModel::IActivityEventListener<System::Workflow::ComponentModel::QueueEventArgs ^>
[System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.DelayActivity), "Resources.Delay.png")] [System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")] [System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.Activities.DelayActivity/DelayActivityValidator))] public sealed class DelayActivity : System.Workflow.ComponentModel.Activity, System.Workflow.Activities.IEventActivity, System.Workflow.ComponentModel.IActivityEventListener<System.Workflow.ComponentModel.QueueEventArgs>
type DelayActivity = class inherit Activity interface IEventActivity interface IActivityEventListener<QueueEventArgs>
Public NotInheritable Class DelayActivity Inherits Activity Implements IActivityEventListener(Of QueueEventArgs), IEventActivity
The following code example demonstrates how to create a new instance of the DelayActivity class. This code example is part of the SimpleStateMachineWorkflow SDK Sample from the StateMachineWorkflow.cs file. For more information, see Simple State Machine.
this.StartState = new System.Workflow.Activities.StateActivity();
Me.StartState = New System.Workflow.Activities.StateActivity()
This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.
When notified that its timer has expired, a DelayActivity completes its execution.
You can set a time out on the DelayActivity so that your workflow pauses before resuming execution. You specify the TimeoutDuration using TimeSpan. This causes your workflow to pause until the specified TimeSpan has elapsed.
The DelayActivity class runs the code method associated with the InitializeTimeoutDuration event before the activity starts and the code-beside method can be used to initialize the TimeoutDuration property.
The DelayActivity is guaranteed to complete no sooner than the indicated TimeoutDuration. The delay can take longer because the timer notification might occur some time after the TimeoutDuration is reached. One reason for a longer delay is if the workflow is running under high system stress in a server environment.
|DelayActivity() DelayActivity() DelayActivity() DelayActivity()||
Initializes a new instance of the DelayActivity class.
|DelayActivity(String) DelayActivity(String) DelayActivity(String) DelayActivity(String)||
Initializes a new instance of the DelayActivity class using the name of the activity.
|InitializeTimeoutDurationEvent InitializeTimeoutDurationEvent InitializeTimeoutDurationEvent InitializeTimeoutDurationEvent|
|TimeoutDurationProperty TimeoutDurationProperty TimeoutDurationProperty TimeoutDurationProperty|
|Description Description Description Description||
Gets or sets the user-defined description of the Activity.(Inherited from Activity)
|DesignMode DesignMode DesignMode DesignMode||
Gets the value that indicates whether this instance is in design or run-time mode.(Inherited from DependencyObject)
|Enabled Enabled Enabled Enabled||
Gets or sets a value that indicates whether this instance is enabled for execution and validation.(Inherited from Activity)
|ExecutionResult ExecutionResult ExecutionResult ExecutionResult||
Gets the ActivityExecutionResult of the last attempt to run this instance.(Inherited from Activity)
|ExecutionStatus ExecutionStatus ExecutionStatus ExecutionStatus||
Gets the current ActivityExecutionStatus of this instance.(Inherited from Activity)
|IsDynamicActivity IsDynamicActivity IsDynamicActivity IsDynamicActivity||
Gets information about whether the activity is executing within the default ActivityExecutionContext of the workflow instance.(Inherited from Activity)
|Name Name Name Name||
Gets or sets the name of this instance. This name must conform to the variable naming convention of the programming language that is being used in the Workflow project.(Inherited from Activity)
|Parent Parent Parent Parent||Activity)|
|ParentDependencyObject ParentDependencyObject ParentDependencyObject ParentDependencyObject||DependencyObject)|
|QualifiedName QualifiedName QualifiedName QualifiedName||
Gets the qualified name of the activity. Qualified activity names are always unique in a workflow instance.(Inherited from Activity)
|Site Site Site Site||DependencyObject)|
|TimeoutDuration TimeoutDuration TimeoutDuration TimeoutDuration||
Gets or sets the duration of the delay in the workflow.
|UserData UserData UserData UserData||
Gets an IDictionary that associates custom data with this class instance.(Inherited from DependencyObject)
|WorkflowInstanceId WorkflowInstanceId WorkflowInstanceId WorkflowInstanceId||
Gets the Guid associated with the instance.(Inherited from Activity)
|Canceling Canceling Canceling Canceling||
Occurs when the activity execution is canceled.(Inherited from Activity)
|Closed Closed Closed Closed||
Occurs when an Activity has completed execution.(Inherited from Activity)
|Compensating Compensating Compensating Compensating||
Occurs when running a compensation method on the Activity.(Inherited from Activity)
|Executing Executing Executing Executing||
Occurs when the Activity is run.(Inherited from Activity)
|Faulting Faulting Faulting Faulting||
Occurs when an exception is raised during the running of the instance.(Inherited from Activity)
|IComponent.Disposed IComponent.Disposed IComponent.Disposed IComponent.Disposed||
Represents the method that handles the Disposed event of a component.(Inherited from DependencyObject)
|InitializeTimeoutDuration InitializeTimeoutDuration InitializeTimeoutDuration InitializeTimeoutDuration||
Occurs before the time-out duration starts.
|StatusChanged StatusChanged StatusChanged StatusChanged||Activity)|