DynamicMethod.ReturnType Proprietà

Definizione

Ottiene il tipo di valore restituito per il metodo dinamico.

public:
 virtual property Type ^ ReturnType { Type ^ get(); };
public override Type ReturnType { get; }
member this.ReturnType : Type
Public Overrides ReadOnly Property ReturnType As Type

Valore della proprietà

Oggetto Type che rappresenta il tipo di valore restituito del metodo corrente; Void se il metodo non contiene tipi restituiti.

Esempio

Nell'esempio di codice seguente viene visualizzato il tipo restituito di un metodo dinamico. Questo esempio di codice fa parte di un esempio più grande fornito per la DynamicMethod classe.

// If the method has no return type, ReturnType is System.Void.
Console::WriteLine("\r\nReturn type: {0}", hello->ReturnType);
// If the method has no return type, ReturnType is System.Void.
Console.WriteLine("\r\nReturn type: {0}", hello.ReturnType);
' If the method has no return type, ReturnType is System.Void.
Console.WriteLine(vbCrLf & "Return type: {0}", hello.ReturnType)

Commenti

Se null è stato specificato per il tipo restituito quando è stato creato il metodo dinamico, questa proprietà restituisce System.Void.

Si applica a