Creates a new argument collection with the given parameters, where the argument values are provided using object initializer syntax.
[EditorBrowsable(EditorBrowsableState.Never)]
public ArgumentCollection(ParameterInfo[] parameters)
This constructor overload, in combination with the Add<T>(String, T?) and
Add<T>(Int32, T?) methods, enables the following usage:
var args = new ArgumentCollection(method.GetParameters())
{
{ "foo", "bar" },
{ "value", 23 },
{ "enabled", true }
};
This is an alternative to the ArgumentCollection.Create factory methods that
might be more intuitive or appropriate depending on the needs (i.e. compile-time
code generation uses this syntax).