Click or drag to resize

TryCastExtension Class

Entry point to create the TryCastWorkerTValue.
Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopTryCastExtension

Namespace: TomsToolbox.Desktop
Assembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public static class TryCastExtension

The TryCastExtension type exposes the following members.

Methods
 NameDescription
Public Extension MethodCode exampleTryCastTValue Creates the TryCastWorkerTValue object to get a fluent notation for try-casting types.

This pattern avoids heavily nested if (class is type) / else chains when testing for more than one possible cast.

Top
See Also