DynamicMethod.ReturnType 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取动态方法的返回值的类型。
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。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈