PropertyConverter.ObjectFromString(Type, MemberInfo, String) Metodo

Definizione

Converte il valore stringa nel tipo di oggetto specificato.

Questa API supporta l'infrastruttura del prodotto e non è previsto che venga usata direttamente dal codice.

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

Parametri

objType
Type

Oggetto Type da creare a partire da value.

propertyInfo
MemberInfo

Proprietà da utilizzare durante la conversione.

value
String

Classe String da convertire in un oggetto.

Restituisce

Object

Oggetto di tipo objType.

Eccezioni

Non è possibile creare un oggetto del tipo specificato da objType a partire dal parametro value.

Commenti

Il ObjectFromString metodo viene utilizzato per convertire un valore stringa in un oggetto.

Nota

Questo membro supporta l'infrastruttura .NET Framework e non è possibile usarlo direttamente dal codice. Per convertire un valore stringa in un oggetto, usare il Parse metodo per l'oggetto se l'oggetto fornisce un Parse metodo. È ad esempio Int32 possibile creare un oggetto da una stringa tramite il Parse metodo.

Si applica a