Compartir a través de


LogicalMethodInfo.MethodInfo Propiedad

Definición

Obtiene los atributos y los metadatos de un método sincrónico.

public:
 property System::Reflection::MethodInfo ^ MethodInfo { System::Reflection::MethodInfo ^ get(); };
public System.Reflection.MethodInfo MethodInfo { get; }
member this.MethodInfo : System.Reflection.MethodInfo
Public ReadOnly Property MethodInfo As MethodInfo

Valor de propiedad

MethodInfo que representa los atributos y los metadatos de un método. Si IsAsync es true, entonces el valor de esta propiedad es null.

Ejemplos

Type^ myType = MyService::typeid;
MethodInfo^ myMethodInfo = myType->GetMethod( "Add" );

// Create a synchronous 'LogicalMethodInfo' instance.
array<MethodInfo^>^temparray = {myMethodInfo};
LogicalMethodInfo^ myLogicalMethodInfo = (LogicalMethodInfo::Create( temparray, LogicalMethodTypes::Sync ))[ 0 ];

// Display the method for which the attributes are being displayed.
Console::WriteLine( "\nDisplaying the attributes for the method : {0}\n", myLogicalMethodInfo->MethodInfo );
Type myType = typeof(MyService);
MethodInfo myMethodInfo = myType.GetMethod("Add");
// Create a synchronous 'LogicalMethodInfo' instance.
LogicalMethodInfo myLogicalMethodInfo =
   (LogicalMethodInfo.Create(new MethodInfo[] {myMethodInfo},
                             LogicalMethodTypes.Sync))[0];
// Display the method for which the attributes are being displayed.
Console.WriteLine("\nDisplaying the attributes for the method : {0}\n",
                     myLogicalMethodInfo.MethodInfo);
Dim myType As Type = GetType(MyService)
Dim myMethodInfo As MethodInfo = myType.GetMethod("Add")
' Create a synchronous 'LogicalMethodInfo' instance.
Dim myLogicalMethodInfo As LogicalMethodInfo = _
           LogicalMethodInfo.Create(New MethodInfo() {myMethodInfo}, LogicalMethodTypes.Sync)(0)
' Display the method for which the attributes are being displayed.
Console.WriteLine(ControlChars.NewLine + "Displaying the attributes for the method : {0}" + _
           ControlChars.NewLine, myLogicalMethodInfo.MethodInfo.ToString())

Se aplica a

Consulte también