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.
Namespace: FolkerKinzel.VCards.ModelsAssembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
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
)
Public MustOverride Sub Switch(Of TArg) (
arg As TArg,
Optional dateAction As Action(Of DateOnly, TArg) = Nothing,
Optional dtoAction As Action(Of DateTimeOffset, TArg) = Nothing,
Optional timeAction As Action(Of TimeOnly, TArg) = Nothing,
Optional stringAction As Action(Of String, TArg) = Nothing
)
public:
generic<typename TArg>
virtual void Switch(
TArg arg,
Action<DateOnly, TArg>^ dateAction = nullptr,
Action<DateTimeOffset, TArg>^ dtoAction = nullptr,
Action<TimeOnly, TArg>^ timeAction = nullptr,
Action<String^, TArg>^ stringAction = nullptr
) abstract
abstract Switch :
arg : 'TArg *
?dateAction : Action<DateOnly, 'TArg> *
?dtoAction : Action<DateTimeOffset, 'TArg> *
?timeAction : Action<TimeOnly, 'TArg> *
?stringAction : Action<string, 'TArg>
(* Defaults:
let _dateAction = defaultArg dateAction null
let _dtoAction = defaultArg dtoAction null
let _timeAction = defaultArg timeAction null
let _stringAction = defaultArg stringAction null
*)
-> unit
- 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.
- TArg
- Generic type parameter for the type of the argument to pass
to the delegates.