次の方法で共有


LogicalMethodInfo.MethodInfo プロパティ

同期メソッドの属性とメタデータを取得します。

Public ReadOnly Property MethodInfo As MethodInfo
[C#]
public MethodInfo MethodInfo {get;}
[C++]
public: __property MethodInfo* get_MethodInfo();
[JScript]
public function get MethodInfo() : MethodInfo;

プロパティ値

メソッドの属性とメタデータを表す MethodInfoIsAsynctrue の場合、このプロパティの値は null 参照 (Visual Basic では Nothing) です。

使用例

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


[C#] 
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);

[C++] 
Type* myType = __typeof(MyService);
MethodInfo* myMethodInfo = myType->GetMethod(S"Add");
// Create a synchronous 'LogicalMethodInfo' instance.
MethodInfo* temparray [] = {myMethodInfo};
LogicalMethodInfo* myLogicalMethodInfo =
   (LogicalMethodInfo::Create(temparray,
   LogicalMethodTypes::Sync))[0];
// Display the method for which the attributes are being displayed.
Console::WriteLine(S"\nDisplaying the attributes for the method : {0}\n",
   myLogicalMethodInfo->MethodInfo);

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

LogicalMethodInfo クラス | LogicalMethodInfo メンバ | System.Web.Services.Protocols 名前空間 | MethodInfo | BeginMethodInfo | EndMethodInfo