SimpleContext Class

Represents a predefined simple context for non-async, possibly parallel operations where the maximum degree of parallelism can be specified, but cancellation and reporting progress is not supported. Can be used for methods with an IAsyncContext parameter where we do not have an existing IAsyncContext instance from a higher level operation, and we want to force the degree of parallelism. To force a single threaded execution you can use the predefined AsyncHelper.SingleThreadContext property.
See the Examples section of the AsyncHelper class for details about IAsyncContext.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public sealed class SimpleContext : IAsyncContext
Inheritance
Object    SimpleContext
Implements
IAsyncContext

Constructors

SimpleContext Initializes a new instance of the SimpleContext class with the specified maximum degree of parallelism.

Properties

MaxDegreeOfParallelism Gets the maximum degree of parallelism. If zero or less, then it is adjusted automatically.

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