AsyncConfig Class

Represents asynchronous configuration for IAsyncResult-returning methods.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public class AsyncConfig : ParallelConfig
Inheritance
Object    AsyncConfigBase    ParallelConfig    AsyncConfig

Constructors

AsyncConfig Initializes a new instance of the AsyncConfig class.
AsyncConfig(CancellationToken) Initializes a new instance of the AsyncConfig class initializing the IsCancelRequestedCallback property from a CancellationToken.
This constructor is available only for .NET Framework 4.0 and later.
AsyncConfig(AsyncCallback, FuncBoolean) Initializes a new instance of the AsyncConfig class.

Properties

CompletedCallback Gets or sets a callback that will be invoked when the operation is completed. This property is ignored for methods that expect a ParallelConfig parameter.
Default value: .
IsCancelRequestedCallback Gets or sets a callback that can return whether cancellation has been requested. To use a CancellationToken on .NET Framework 4.0 or later, use the appropriate constructor or the TaskConfig type with Task-returning methods.
Default value: , if the default constructor was called.
(Inherited from ParallelConfig)
MaxDegreeOfParallelism Gets or sets the maximum degree of parallelism. Zero or less means an automatic configuration based on CPU cores. Set one to execute the operation on a single core. The asynchronous operation will not be blocking even if 1 is set.
Default value: 0.
(Inherited from AsyncConfigBase)
Progress Gets or sets an IAsyncProgress instance that can handle progress notifications.
Default value: .
See the Examples section of the IAsyncProgress interface for an example implementation.
(Inherited from AsyncConfigBase)
State Gets or sets a user-provided object that will be returned by the AsyncState property that can be used to distinguish this particular asynchronous operation from other ones. This object will be returned also in the IAsyncContext.State property created by the methods of the AsyncHelper class.
Default value: .
(Inherited from AsyncConfigBase)
ThrowIfCanceled Gets or sets whether an OperationCanceledException should be thrown when ending or awaiting a canceled async operation. If the value of this property is , then canceled non-void operations will return some value, which is usually the default value of their return type.
Default value: .
(Inherited from AsyncConfigBase)

Extension Methods

Convert Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions)
ConvertTTarget Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions)
In Gets whether item is among the elements of set.
See the Examples section of the generic InT(T, T) overload for an example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvert Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)
TryConvertTTarget Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions)

See Also