Partager via


LogicalMethodInfo.MethodInfo Propriété

Définition

Obtient les attributs et les métadonnées d'une méthode synchrone.

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

Valeur de propriété

MethodInfo représentant les attributs et les métadonnées d'une méthode. Si IsAsync est true, la valeur de cette propriété est null.

Exemples

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

S’applique à

Voir aussi