Aracılığıyla paylaş


LogicalMethodInfo.MethodInfo Özellik

Tanım

Zaman uyumlu bir yöntem için öznitelikleri ve meta verileri alır.

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

Özellik Değeri

Bir MethodInfo yöntemin özniteliklerini ve meta verilerini temsil eden. ise IsAsynctrue, bu özelliğin değeri olur null.

Örnekler

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

Şunlara uygulanır

Ayrıca bkz.