DynamicMethod.ReturnType プロパティ

定義

動的メソッドの戻り値の型を取得します。

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

プロパティ値

現在のメソッドの戻り値の型を表す Type。メソッドに戻り値の型がない場合は Void

次のコード例では、動的メソッドの戻り値の型を表示します。 このコード例は、DynamicMethod クラスのために提供されている大規模な例の一部です。

// 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)

注釈

動的メソッドの作成時に戻り値の型に が指定された場合 null 、このプロパティは を返します System.Void

適用対象