Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: bool Try(object, out bool)

Declaration

public static bool Try(
    object value,
    out bool result
)

Summary

Converts the specified object to a bool. Returns true if successful, or false if the object cannot be converted exactly. result is set to the type's default value if the conversion is unsuccessful. If the value is one of the integer types, the exact conversion only succeeds if the value is in range, i.e. 0 or 1. If converting from a string, the string must be exactly (case-insensitive) equal to "True" or "False", or the conversion will fail.