Add(String, T?) Method

Definition

Namespace Stunts
Assembly Stunts.dll

Sets (or adds) the value of the parameter with the given name.

[EditorBrowsable(EditorBrowsableState.Never)]
public void Add<T>(string name, T? value)

Type parameters

T
Type of the value being set.

Parameters

name
String

Name of the argument being set.

value
{T}

Value of the argument.

Remarks

This method is similar to SetValue(Int32, Object?) but can also add values to parameters which haven't been assigned a value yet, and supports object initialization syntax so you can write code like:

var args = new ArgumentCollection(parameters) 
{
  { "message", "hello" },
  { "count", 25 },
  { "enabled", true },
};