ArgIterator コンストラクタ (RuntimeArgumentHandle)
アセンブリ: mscorlib (mscorlib.dll 内)


新しい ArgIterator オブジェクトは、最初の省略可能な引数から始まる引数リストを列挙します。
実装時の注意 このコンストラクタは、特に C/C++ プログラミング言語で使用するために用意されています。
ArgIterator コンストラクタのコード例を次に示します。
// This code example demonstrates the ArgIterator constructor. using System; public class Sample { public static void Main() { // Call a method with a variable argument list. int i=0; Test.printArg( (double)23.7, ref i, __arglist( typeof(int), "hello", UIntPtr.Zero ) ); } } public class Test { public unsafe static void printArg(double d, ref int i, __arglist) { // Get the argument list, starting at the first argument. ArgIterator args = new ArgIterator( __arglist, null); /* // Get the argument list, starting at the first optional argument. ArgIterator args = new ArgIterator( __arglist ); */ // Display the type of each argument in the argument list. TypedReference tr; while(true) { try { tr = args.GetNextArg(); Console.WriteLine( TypedReference.GetTargetType(tr) ); } catch ( InvalidOperationException ) { break; } } } } /* This code example produces the following results if you use "new ArgIterator( __arglist, null)": System.Double System.Int32 System.Type System.String System.UIntPtr This code example produces the following results if you use the commented statement, "new ArgIterator(__arglist)": System.Type System.String System.UIntPtr */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ArgIterator コンストラクタ

名前 | 説明 |
---|---|
ArgIterator (RuntimeArgumentHandle) | 指定した引数リストを使用して、ArgIterator 構造体の新しいインスタンスを初期化します。 |
ArgIterator (RuntimeArgumentHandle, Void*) | 指定した引数リストとリスト内の項目へのポインタを使用して、ArgIterator 構造体の新しいインスタンスを初期化します。 |

ArgIterator コンストラクタ (RuntimeArgumentHandle, Void*)
アセンブリ: mscorlib (mscorlib.dll 内)


新しい ArgIterator オブジェクトは、ptr で指定した引数から始まる引数リストを列挙します。ptr が null 参照 (Visual Basic では Nothing) の場合は、最初の必須の引数から始まる引数リストを列挙します。
実装時の注意 このコンストラクタは、特に C/C++ プログラミング言語で使用するために用意されています。
ArgIterator コンストラクタのコード例を次に示します。
// This code example demonstrates the ArgIterator constructor. using System; public class Sample { public static void Main() { // Call a method with a variable argument list. int i=0; Test.printArg( (double)23.7, ref i, __arglist( typeof(int), "hello", UIntPtr.Zero ) ); } } public class Test { public unsafe static void printArg(double d, ref int i, __arglist) { // Get the argument list, starting at the first argument. ArgIterator args = new ArgIterator( __arglist, null); /* // Get the argument list, starting at the first optional argument. ArgIterator args = new ArgIterator( __arglist ); */ // Display the type of each argument in the argument list. TypedReference tr; while(true) { try { tr = args.GetNextArg(); Console.WriteLine( TypedReference.GetTargetType(tr) ); } catch ( InvalidOperationException ) { break; } } } } /* This code example produces the following results if you use "new ArgIterator( __arglist, null)": System.Double System.Int32 System.Type System.String System.UIntPtr This code example produces the following results if you use the commented statement, "new ArgIterator(__arglist)": System.Type System.String System.UIntPtr */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- ArgIterator コンストラクタのページへのリンク