public XamlTypeResolverProvider(XamlObject containingObject) { if (containingObject == null) { throw new ArgumentNullException("containingObject"); } this.document = containingObject.OwnerDocument; this.containingObject = containingObject; }
internal XamlTextValue(XamlDocument document, string textValue) { this.document = document; if (textValue.StartsWith("{")) { textValue = "{}" + textValue; } this.textValue = textValue; }
/// <summary>For use by XamlParser only.</summary> internal XamlObject(XamlDocument document, XmlElement element, Type elementType, object instance) { this.document = document; this.element = element; this.elementType = elementType; this.instance = instance; this.contentPropertyName = GetContentPropertyName(elementType); XamlSetTypeConverter = GetTypeConverterDelegate(elementType); ServiceProvider = new XamlObjectServiceProvider(this); CreateWrapper(); var rnpAttrs = elementType.GetCustomAttributes(typeof(RuntimeNamePropertyAttribute), true) as RuntimeNamePropertyAttribute[]; if (rnpAttrs != null && rnpAttrs.Length > 0 && !String.IsNullOrEmpty(rnpAttrs[0].Name)) { runtimeNameProperty = rnpAttrs[0].Name; } }
static XmlNode FindChildNode(XmlNode node, Type elementType, string propertyName, XamlDocument xamlDocument) { var localName = elementType.Name + "." + propertyName; var namespacesURI = xamlDocument.GetNamespacesFor(elementType); var clrNamespaceURI = xamlDocument.GetNamespaceFor(elementType, true); foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == localName && (namespacesURI.Contains(childNode.NamespaceURI) || childNode.NamespaceURI == clrNamespaceURI)) { return(childNode); } } var type = elementType.BaseType; namespacesURI = xamlDocument.GetNamespacesFor(type); while (type != typeof(object)) { if (type.GetProperty(propertyName) == null) { break; } localName = type.Name + "." + propertyName; foreach (XmlNode childNode in node.ChildNodes) { if (childNode.LocalName == localName && namespacesURI.Contains(childNode.NamespaceURI)) { return(childNode); } } type = type.BaseType; } return(null); }
internal XamlTextValue(XamlDocument document, XmlCDataSection cDataSection, XmlSpace xmlSpace) { this.document = document; this.xmlSpace = xmlSpace; this.cDataSection = cDataSection; }
internal XamlTextValue(XamlDocument document, XmlText textNode, XmlSpace xmlSpace) { this.document = document; this.xmlSpace = xmlSpace; this.textNode = textNode; }
internal XamlTextValue(XamlDocument document, XmlAttribute attribute) { this.document = document; this.attribute = attribute; }