ArgIteratorとは? わかりやすく解説

ArgIterator コンストラクタ (RuntimeArgumentHandle)

指定した引数リスト使用して、ArgIterator 構造体新しインスタンス初期化します。

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    arglist As RuntimeArgumentHandle _
)
Dim arglist As RuntimeArgumentHandle

Dim instance As New ArgIterator(arglist)
public ArgIterator (
    RuntimeArgumentHandle arglist
)
public:
ArgIterator (
    RuntimeArgumentHandle arglist
)
public ArgIterator (
    RuntimeArgumentHandle arglist
)
public function ArgIterator (
    arglist : RuntimeArgumentHandle
)

パラメータ

arglist

必須の引数省略可能な引数構成される引数リスト

解説解説
使用例使用例

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

*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ArgIterator コンストラクタ

ArgIterator 構造体新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

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

関連項目

ArgIterator 構造体
ArgIterator メンバ
System 名前空間

ArgIterator コンストラクタ (RuntimeArgumentHandle, Void*)

指定した引数リストリスト内の項目へのポインタ使用して、ArgIterator 構造体新しインスタンス初期化します。

このコンストラクタは、CLS準拠していません。  

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

[CLSCompliantAttribute(false)] 
public ArgIterator (
    RuntimeArgumentHandle arglist,
    void* ptr
)
[CLSCompliantAttribute(false)] 
public:
ArgIterator (
    RuntimeArgumentHandle arglist, 
    void* ptr
)
J# は、安全でない型を使用した戻したりする APIサポートしません。

パラメータ

arglist

必須の引数省略可能な引数構成される引数リスト

ptr

最初にアクセスする arglist 内の引数へのポインタptrnull 参照 (Visual Basic では Nothing) の場合は、arglist 内の最初必須の引数へのポインタ

解説解説
使用例使用例

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

*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ArgIterator メソッド


ArgIterator メンバ


ArgIterator 構造体

さまざまな数の引数受け取関数パラメータ示されている、可変長引数リスト表します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

public struct ArgIterator
public value class ArgIterator
public final class ArgIterator extends ValueType
JScript では、構造体使用できますが、新規に宣言することはできません。
解説解説
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ArgIterator」の関連用語

ArgIteratorのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ArgIteratorのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS