DateAndOrTimeSwitchTArg(TArg, ActionDateOnly, TArg, ActionDateTimeOffset, TArg, ActionTimeOnly, TArg, ActionString, TArg) Method

Performs an ActionT depending on the Type of the encapsulated value and allows to pass an argument to the delegates.

Definition

Namespace: FolkerKinzel.VCards.Models
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public abstract void Switch<TArg>(
	TArg arg,
	Action<DateOnly, TArg>? dateAction = null,
	Action<DateTimeOffset, TArg>? dtoAction = null,
	Action<TimeOnly, TArg>? timeAction = null,
	Action<string, TArg>? stringAction = null
)

Parameters

arg  TArg
The argument to pass to the delegates.
dateAction  ActionDateOnly, TArg  (Optional)
null, or the ActionT to perform if the encapsulated value is a DateOnly.
dtoAction  ActionDateTimeOffset, TArg  (Optional)
null, or the ActionT to perform if the encapsulated value is a DateTimeOffset.
timeAction  ActionTimeOnly, TArg  (Optional)
null, or the ActionT to perform if the encapsulated value is a TimeOnly.
stringAction  ActionString, TArg  (Optional)
null, or the ActionT to perform if the encapsulated value is a String.

Type Parameters

TArg
Generic type parameter for the type of the argument to pass to the delegates.

See Also