LogicalMethodInfo.OutParameters Property
.NET Framework 2.0
Gets the out parameters for the method.
Namespace: System.Web.Services.Protocols
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
/** @property */ public ParameterInfo[] get_OutParameters ()
public function get OutParameters () : ParameterInfo[]
Not applicable.
Property Value
An array of ParameterInfo representing the out parameters for the method, in order.#using <System.Web.Services.dll> using namespace System; using namespace System::Runtime::InteropServices; using namespace System::Reflection; using namespace System::Web::Services::Protocols; public ref class MyService { public: void MyMethod( int inParameter, [Out]interior_ptr<int> outParameter ) { *outParameter = inParameter; } }; int main() { Type^ myType = MyService::typeid; MethodInfo^ myMethodInfo = myType->GetMethod( "MyMethod" ); array<MethodInfo^>^temparray = {myMethodInfo}; LogicalMethodInfo^ myLogicalMethodInfo = (LogicalMethodInfo::Create( temparray ))[ 0 ]; Console::WriteLine( "\nPrinting parameters for the method : {0}", myLogicalMethodInfo->Name ); Console::WriteLine( "\nThe parameters of the method {0} are :\n", myLogicalMethodInfo->Name ); array<ParameterInfo^>^myParameters = myLogicalMethodInfo->Parameters; for ( int i = 0; i < myParameters->Length; i++ ) { Console::WriteLine( String::Concat( "\t ", myParameters[ i ]->Name, " : ", myParameters[ i ]->ParameterType ) ); } Console::WriteLine( "\nThe in parameters of the method {0} are :\n", myLogicalMethodInfo->Name ); myParameters = myLogicalMethodInfo->InParameters; for ( int i = 0; i < myParameters->Length; i++ ) { Console::WriteLine( String::Concat( "\t ", myParameters[ i ]->Name, " : ", myParameters[ i ]->ParameterType ) ); } Console::WriteLine( "\nThe out parameters of the method {0} are :\n", myLogicalMethodInfo->Name ); myParameters = myLogicalMethodInfo->OutParameters; for ( int i = 0; i < myParameters->Length; i++ ) { Console::WriteLine( String::Concat( "\t ", myParameters[ i ]->Name, " : ", myParameters[ i ]->ParameterType ) ); } if ( myLogicalMethodInfo->IsVoid ) Console::WriteLine( "\nThe return type is void" ); else Console::WriteLine( "\nThe return type is {0}", myLogicalMethodInfo->ReturnType ); }
import System.*;
import System.Reflection.*;
import System.Web.Services.Protocols.*;
public class MyService
{
public void MyMethod(int inParameter, /** @ref */int outParameter)
{
outParameter = inParameter;
} //MyMethod
} //MyService
public class LogicalMethodInfo_Create
{
public static void main(String[] args)
{
Type myType = MyService.class.ToType();
MethodInfo myMethodInfo = myType.GetMethod("MyMethod");
LogicalMethodInfo myLogicalMethodInfo = (LogicalMethodInfo)
LogicalMethodInfo.Create(new MethodInfo[] { myMethodInfo }).
get_Item(0);
Console.WriteLine("\nPrinting parameters for the method : {0}",
myLogicalMethodInfo.get_Name());
Console.WriteLine("\nThe parameters of the method {0} are :\n",
myLogicalMethodInfo.get_Name());
ParameterInfo myParameters[] = myLogicalMethodInfo.get_Parameters();
for (int i = 0; i < myParameters.length; i++) {
Console.WriteLine("\t"
+ ((ParameterInfo)myParameters.get_Item(i)).get_Name() + " : "
+ ((ParameterInfo)myParameters.get_Item(i)).get_ParameterType());
}
Console.WriteLine("\nThe in parameters of the method {0} are :\n",
myLogicalMethodInfo.get_Name());
myParameters = myLogicalMethodInfo.get_InParameters();
for (int i = 0; i < myParameters.length; i++) {
Console.WriteLine("\t"
+ ((ParameterInfo)myParameters.get_Item(i)).get_Name() + " : "
+ ((ParameterInfo)myParameters.get_Item(i)).
get_ParameterType());
}
Console.WriteLine("\nThe out parameters of the method {0} are :\n",
myLogicalMethodInfo.get_Name());
myParameters = myLogicalMethodInfo.get_OutParameters();
for (int i = 0; i < myParameters.length; i++) {
Console.WriteLine("\t"
+ ((ParameterInfo)myParameters.get_Item(i)).get_Name() + " : "
+ ((ParameterInfo)myParameters.get_Item(i)).
get_ParameterType());
}
if (myLogicalMethodInfo.get_IsVoid()) {
Console.WriteLine("\nThe return type is void");
}
else {
Console.WriteLine("\nThe return type is {0}",
myLogicalMethodInfo.get_ReturnType());
}
} //main
} //LogicalMethodInfo_Create
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: