internal void Parse(ParseResult result, XElement node, string baseUri, bool addImageQuery) { if (!XmlTemplateParser.EnsureNodeOnlyHasElementsAsChildren(result, node)) { throw new IncompleteElementException(); } AttributesHelper attributes = new AttributesHelper(node.Attributes()); ParseKnownAttributes(node, attributes, result, baseUri, addImageQuery); HandleRemainingAttributes(attributes, result); // 0-n children foreach (XElement child in node.Elements()) { try { HandleChild(result, child, baseUri, addImageQuery); } catch (IncompleteElementException) { } } }
internal void Parse(ParseResult result, XElement node) { if (!XmlTemplateParser.EnsureNodeOnlyHasElementsAsChildren(result, node)) { throw new IncompleteElementException(); } AttributesHelper attributes = new AttributesHelper(node.Attributes()); ParseKnownAttributes(node, attributes, result); HandleRemainingAttributes(attributes, result); // 0-n children foreach (XElement child in node.Elements()) { if (!result.IsOkForRender()) { break; } try { HandleChild(result, child); } catch (IncompleteElementException) { } } }
internal void Parse(ParseResult result, XElement node) { if (!XmlTemplateParser.EnsureNodeOnlyHasElementsAsChildren(result, node)) { throw new IncompleteElementException(); } AttributesHelper attributes = new AttributesHelper(node.Attributes()); ParseKnownAttributes(node, attributes, result); HandleRemainingAttributes(attributes, result); }
internal void Parse(ParseResult result, XElement node, string baseUri, bool addImageQuery) { if (!XmlTemplateParser.EnsureNodeOnlyHasElementsAsChildren(result, node)) { throw new IncompleteElementException(); } AttributesHelper attributes = new AttributesHelper(node.Attributes()); ParseKnownAttributes(node, attributes, result, baseUri, addImageQuery); AdaptiveContainer container = new AdaptiveContainer(Context, SupportedFeatures); container.ContinueParsing(result, node, attributes, node.Elements(), baseUri, addImageQuery); Container = container; HandleRemainingAttributes(attributes, result); }
internal void Parse(ParseResult result, XElement node) { if (!XmlTemplateParser.EnsureNodeOnlyHasElementsAsChildren(result, node)) { throw new IncompleteElementException(); } AttributesHelper attributes = new AttributesHelper(node.Attributes()); // BaseUri is optional string baseUri = null; { XAttribute attrBaseUri = attributes.PopAttribute(ATTR_VISUAL_BASEURI); if (attrBaseUri != null) { baseUri = attrBaseUri.Value; Uri uri; if (Uri.TryCreate(baseUri, UriKind.RelativeOrAbsolute, out uri)) { BaseUri = uri; } } } // AddImageQuery is optional bool addImageQuery; if (TryParse(result, attributes, ATTR_VISUAL_ADDIMAGEQUERY, out addImageQuery)) { AddImageQuery = addImageQuery; } else { addImageQuery = false; // Defaults to false if not specified } if (Context == NotificationType.Tile) { if (SupportedFeatures.ChaseableTiles) { XAttribute attrArguments = attributes.PopAttribute(ATTR_VISUAL_ARGUMENTS); if (attrArguments != null) { Arguments = attrArguments.Value; } } } ParseKnownAttributes(attributes, result, baseUri, addImageQuery); HandleRemainingAttributes(attributes, result); foreach (XElement n in node.Elements()) { try { HandleChild(result, n, baseUri, addImageQuery); } catch (IncompleteElementException) { } } }