Mono Class Library: System.ArgIterator Overview | Members

System.ArgIterator Constructor

Creates an ArgIterator from a RuntimeArgumentHandle. [Edit]

public ArgIterator (RuntimeArgumentHandle arglist)

Parameters

arglist
The handle to the argument list, as obtained by the special compiler __arglist expression. [Edit]

Remarks

Here is an example of a routine that uses the __arglist calling conventions:
C# Example
using System;

class ArgIteratorDemo {

        static int AddABunchOfInts (__arglist)
        {
                int result = 0;

                System.ArgIterator iter = new System.ArgIterator (__arglist);
                int argCount = iter.GetRemainingCount();

                for (int i = 0; i < argCount; i++) {
                        System.TypedReference typedRef = iter.GetNextArg();
                        result += (int)TypedReference.ToObject( typedRef );
                }

                return result;
        }

        static void Main (string[] args)
        {
                int result = AddABunchOfInts (__arglist ( 2, 3, 4 ));
                Console.WriteLine ("Answer: {0}", result);
	}
}
  
[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0