#if NET20 || NET30 || NET35 || !NET_4_6 namespace System.Threading.Tasks { /// Specifies the behavior for a task that is created by using the or method. [Flags] [Serializable] public enum TaskContinuationOptions { /// Default = "Continue on any, no task options, run asynchronously" Specifies that the default behavior should be used. Continuations, by default, will be scheduled when the antecedent task completes, regardless of the task's final . None = 0, /// A hint to a to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner will be more likely to be run sooner, and tasks scheduled later will be more likely to be run later. PreferFairness = 1, /// Specifies that a task will be a long-running, course-grained operation. It provides a hint to the that oversubscription may be warranted. LongRunning = 2, /// Specifies that a task is attached to a parent in the task hierarchy. AttachedToParent = 4, DenyChildAttach = 8, HideScheduler = 16, LazyCancellation = 32, RunContinuationsAsynchronously = 64, /// Specifies that the continuation task should not be scheduled if its antecedent ran to completion. This option is not valid for multi-task continuations. NotOnRanToCompletion = 65536, /// Specifies that the continuation task should not be scheduled if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations. NotOnFaulted = 131072, /// Specifies that the continuation task should be scheduled only if its antecedent was canceled. This option is not valid for multi-task continuations. OnlyOnCanceled = 196608, /// Specifies that the continuation task should not be scheduled if its antecedent was canceled. This option is not valid for multi-task continuations. NotOnCanceled = 262144, /// Specifies that the continuation task should be scheduled only if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations. OnlyOnFaulted = 327680, /// Specifies that the continuation task should be scheduled only if its antecedent ran to completion. This option is not valid for multi-task continuations. OnlyOnRanToCompletion = 393216, /// Specifies that the continuation task should be executed synchronously. With this option specified, the continuation will be run on the same thread that causes the antecedent task to transition into its final state. If the antecedent is already complete when the continuation is created, the continuation will run on the thread creating the continuation. Only very short-running continuations should be executed synchronously. ExecuteSynchronously = 524288 } } #endif