Click or drag to resize

TryCastWorkerTValueWhenTTarget Method

Tries to cast the value to TTarget; if the cast succeeds, the action is executed.

Namespace:  TomsToolbox.Desktop
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll)
Syntax
public TryCastWorker<TValue> When<TTarget>(
	Action<TTarget> action
)
where TTarget : class, TValue

Parameters

action
Type: SystemActionTTarget
The action.

Type Parameters

TTarget
The type of the target.

Return Value

Type: TryCastWorkerTValue
The object itself to continue with fluent notation.
Remarks
If any previous method in the fluent chain has already succeeded, this method does nothing.
See Also