PropertyConverter.ObjectFromString(Type, MemberInfo, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts the string value to the specified object type.
This API supports the product infrastructure and is not intended to be used directly from your code.
public:
static System::Object ^ ObjectFromString(Type ^ objType, System::Reflection::MemberInfo ^ propertyInfo, System::String ^ value);
public static object ObjectFromString (Type objType, System.Reflection.MemberInfo propertyInfo, string value);
static member ObjectFromString : Type * System.Reflection.MemberInfo * string -> obj
Public Shared Function ObjectFromString (objType As Type, propertyInfo As MemberInfo, value As String) As Object
Parameters
- propertyInfo
- MemberInfo
The properties to use during conversion.
Returns
An object of type objType
.
Exceptions
An object of the type specified by objType
cannot be created from the value
parameter.
Remarks
The ObjectFromString method is used to convert a string value to an object.
Note
This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. To convert a string value to an object, use the Parse
method for that object if the object provides a Parse
method. For example, an Int32 object can be created from a string through the Parse method.