SetValue() публичный Метод

public SetValue ( XamlObjectElement obj, object value ) : void
obj XamlObjectElement
value object
Результат void
Пример #1
0
        private void AddChildObject(XamlObjectElement obj)
        {
            object        value   = obj.Object;
            MutableObject mutable = value as MutableObject;

            if (mutable != null)
            {
                value = mutable.Object;
            }

            IList list = Object as IList;

            if (list != null)
            {
                list.Add(value);
                return;
            }

            IDictionary dict = Object as IDictionary;

            if (dict != null)
            {
                dict.Add(obj.GetDictionaryKey(), value);
                return;
            }

            XamlReflectionPropertySetter content_property = FindContentProperty();

            if (content_property == null)
            {
                throw Parser.ParseException("Unable to add element {0} to element {1}.", obj.Name, Name);
            }

            content_property.SetValue(value);
        }