bool AddToCollectionIfAppropriate (XamlType xt, XamlMember xm, object parent, object obj, object keyObj)
{
var mt = xm.Type;
if (xm == XamlLanguage.Items ||
xm == XamlLanguage.PositionalParameters ||
xm == XamlLanguage.Arguments) {
if (xt.IsDictionary)
mt.Invoker.AddToDictionary (parent, GetCorrectlyTypedValue (xt.KeyType, keyObj), GetCorrectlyTypedValue (xt.ItemType, obj));
else // collection. Note that state.Type isn't usable for PositionalParameters to identify collection kind.
mt.Invoker.AddToCollection (parent, GetCorrectlyTypedValue (xt.ItemType, obj));
return true;
}
else
return false;
}