This documentation is archived and is not being maintained.

LogicalMethodInfo.MethodInfo Property

Gets the attributes and metadata for a synchronous method.

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

Property Value

A MethodInfo representing the attributes and metadata for a method. If IsAsync is true, then the value of this property is a null reference (Nothing in Visual Basic).

Example

[Visual Basic] 
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] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

LogicalMethodInfo Class | LogicalMethodInfo Members | System.Web.Services.Protocols Namespace | MethodInfo | BeginMethodInfo | EndMethodInfo

Show: