System.Xaml.XamlObjectWriterInternal.AddToCollectionIfAppropriate C# (CSharp) Method

AddToCollectionIfAppropriate() private method

private AddToCollectionIfAppropriate ( XamlType xt, System.Xaml.XamlMember xm, object parent, object obj, object keyObj ) : bool
xt XamlType
xm System.Xaml.XamlMember
parent object
obj object
keyObj object
return bool
		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;
		}