Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: void Pause(TimeSpan?)

Declaration

public void Pause(
    TimeSpan? duration = null
)

Summary

Pauses the command for the specified duration by suspending every thread in every process in the process tree. Throws if the command hasn't been started or has been aborted. Does nothing if the command has exited. If called when already paused, will make sure the command is paused for at least the specified duration, but will not shorten the resume timer. See Remarks.

Parameters

TimeSpan?duration Pause duration. Zero and negative intervals do not pause the command at all. Use TimeSpan.MaxValue or null for an indefinite pause.

Remarks

It is theoretically possible for this to fail to suspend all threads in all processes, if a new thread is created while the threads are being suspended. The current code does not address this scenario, but this can be fixed, if necessary.