|
Iteration support is provided with the standard IEnumerator
type, instantiated with Parameters.Entry
. The Parameters
class itself implements the IEnumerable
interface as well, which means that it can be naturally used in iterative contexts.
A typical usage pattern could be similar to the following code that prints the names of all entries in the given parameters object:
foreach (Parameters.Entry e in params) { System.Console.WriteLine(e.Name); }
Note:
Individual entries can be modified during the iteration, but they should not be added nor removed from the collection while the iteration is in progress.
The size of the whole collection can be always obtained with the Count
property of the parameters object.