LogicalMethodInfo.MethodInfo Proprietà

Definizione

Ottiene gli attributi e i metadati relativi a un metodo sincrono.

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

Valore della proprietà

Oggetto MethodInfo che rappresenta gli attributi e i metadati relativi a un metodo. Se IsAsync è true, il valore di questa proprietà è null.

Esempio

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

Si applica a

Vedi anche