public override void AddChild(XamlElement child) { XamlPropertyElement prop = child as XamlPropertyElement; if (prop != null) { AddChildProperty(prop); return; } AddChildObject((XamlObjectElement)child); }
private void AddChildProperty(XamlPropertyElement prop) { prop.DoSet(); }
private void ParentPropertyElement (XamlElement element, XamlPropertyElement prop) { XamlObjectElement obj = (XamlObjectElement) element; }
private void ParsePropertyElement () { Type t = ResolveType (); if (t == null) throw ParseException ("Unable to find the property {0}.", reader.LocalName); XamlPropertySetter setter = null; if (CurrentElement != null) { XamlObjectElement parent = CurrentElement as XamlObjectElement; if (parent == null) throw ParseException ("Property {0} does not have a parent.", reader.LocalName); if (!t.IsAssignableFrom (parent.Type)) throw ParseException ("Property {0} is not a descendant if its parent object {1}.", reader.LocalName, parent.Type); setter = CurrentElement.LookupProperty (reader); if (setter == null) throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name); } XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter); OnElementBegin (element); }
private void ParsePropertyElement () { Log ("\tParsePropertyElement {0} {1}", reader.Name, CurrentElement.Name); if (reader.ManagedType == null) reader.ManagedType = ResolveType (); if (reader.ManagedType == null) throw ParseException ("Unable to find the property {0}.", reader.LocalName); XamlPropertySetter setter = null; if (CurrentElement != null) { XamlObjectElement parent = CurrentElement as XamlObjectElement; if (parent == null) throw ParseException ("Property {0} does not have a parent.", reader.LocalName); setter = CurrentElement.LookupProperty (reader); if (setter == null) throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name); } else throw ParseException ("A property element cannot be at the root of a document."); XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter); OnElementBegin (element); }
private void AddChildProperty (XamlPropertyElement prop) { prop.DoSet (); }
private void ParsePropertyElement () { Type t = ResolveType (); if (t == null) throw ParseException ("Unable to find the property {0}.", reader.LocalName); XamlPropertySetter setter = null; if (CurrentElement != null) { XamlObjectElement parent = CurrentElement as XamlObjectElement; if (parent == null) throw ParseException ("Property {0} does not have a parent.", reader.LocalName); setter = CurrentElement.LookupProperty (reader); if (setter == null) throw ParseException ("Property {0} was not found on type {1}.", reader.LocalName, CurrentElement.Name); } else throw ParseException ("A property element cannot be at the root of a document."); XamlPropertyElement element = new XamlPropertyElement (this, reader.LocalName, setter); OnElementBegin (element); // This is a self closing element ie <Deployment.Icons /> if (reader.IsEmptyElement) OnElementEnd (); }