MethodInfo.ReturnType Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene el tipo de valor devuelto por este método.
public:
virtual property Type ^ ReturnType { Type ^ get(); };
public:
abstract property Type ^ ReturnType { Type ^ get(); };
public virtual Type ReturnType { get; }
public abstract Type ReturnType { get; }
member this.ReturnType : Type
Public Overridable ReadOnly Property ReturnType As Type
Public MustOverride ReadOnly Property ReturnType As Type
Valor de propiedad
Tipo de valor devuelto del método.
Implementaciones
Ejemplos
En el ejemplo siguiente se muestra el tipo de valor devuelto del método especificado.
using namespace System;
using namespace System::Reflection;
int main()
{
Console::WriteLine( "\nReflection.MethodInfo" );
// Get the Type and MethodInfo.
Type^ MyType = Type::GetType( "System.Reflection.FieldInfo" );
MethodInfo^ Mymethodinfo = MyType->GetMethod( "GetValue" );
Console::Write( "\n{0}.{1}", MyType->FullName, Mymethodinfo->Name );
// Get and display the ReturnType.
Console::Write( "\nReturnType = {0}", Mymethodinfo->ReturnType );
return 0;
}
using System;
using System.Reflection;
class Mymethodinfo
{
public static int Main()
{
Console.WriteLine ("\nReflection.MethodInfo");
// Get the Type and MethodInfo.
Type MyType = Type.GetType("System.Reflection.FieldInfo");
MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
Console.Write ("\n" + MyType.FullName + "." + Mymethodinfo.Name);
// Get and display the ReturnType.
Console.Write ("\nReturnType = {0}", Mymethodinfo.ReturnType);
return 0;
}
}
Imports System.Reflection
Class Mymethodinfo1
Public Shared Function Main() As Integer
Console.WriteLine(ControlChars.Cr + "Reflection.MethodInfo")
'Get the Type and MethodInfo.
Dim MyType As Type = Type.GetType("System.Reflection.FieldInfo")
Dim Mymethodinfo As MethodInfo = MyType.GetMethod("GetValue")
Console.Write(ControlChars.Cr _
+ MyType.FullName + "." + Mymethodinfo.Name)
'Get and display the ReturnType.
Console.Write(ControlChars.Cr _
+ "ReturnType = {0}", Mymethodinfo.ReturnType)
Return 0
End Function
End Class
Comentarios
Para obtener la propiedad de tipo de valor devuelto, obtenga primero la clase Type
.
Type
En , obtenga .MethodInfo
MethodInfo
En , obtenga .ReturnType