ObjectExtensionConvertT(Object, NullableNumberStyles, CultureInfo, NullableDateTimeStyles) Method

Converts an object to a specified type.

Definition

Namespace: FileHold.LibraryManager.Extensions
Assembly: FileHold.LibraryManager (in FileHold.LibraryManager.dll) Version: 17.2.0.0
C#
public static T Convert<T>(
	this Object value,
	NumberStyles? numberStyles = null,
	CultureInfo cultureInfo = null,
	DateTimeStyles? dateTimeStyles = null
)

Parameters

value  Object
The object to convert.
numberStyles  NullableNumberStyles  (Optional)
The number styles.
cultureInfo  CultureInfo  (Optional)
The culture information to use for formatting.
dateTimeStyles  NullableDateTimeStyles  (Optional)
The style of data type.

Type Parameters

T
The target type to convert to.

Return Value

T
The converted value of the specified type, or null if the conversion fails.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ExceptionThrown when the conversion cannot be performed.

See Also