I am currently using this ugly code to add a bunch of key/value pairs (kept in a Dictionairy) to a JObject. It does not add them as children, but as siblings. Well the code works, but it would be cleaner if they were added as child nodes. (the dynamic object e, holds the JObject)
public void trigger(dynamic e ,Pairs extras)
{
if (Post != null)
{
foreach (KeyValuePair<string, object> entry in extras)
{
Newtonsoft.Json.Linq.JValue val = new Newtonsoft.Json.Linq.JValue(entry.Value);
e.Add(entry.Key, val);
}
Post(this, e);
}
}