private IEnumerable<ProtoXamlNode> CommonNodesOfElement(XamlType owner, ProtoXamlNode elementToInject, AttributeFeed attributeFeed) { var attributes = attributeFeed; foreach (var node in attributes.PrefixRegistrations.Select(ConvertAttributeToNsPrefixDefinition)) yield return node; yield return elementToInject; foreach (var node in attributes.RawAttributes.Select(a => ConvertAttributeToNode(owner, a))) yield return node; }
private IEnumerable<ProtoXamlNode> ParseExpandedElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes) { var element = nodeBuilder.NonEmptyElement(xamlType.UnderlyingType, namespaceDeclaration); foreach (var node in CommonNodesOfElement(xamlType, element, attributes)) yield return node; reader.Read(); foreach (var node in ParseInnerTextIfAny()) yield return node; foreach (var protoXamlNode in ParseNestedElements(xamlType)) yield return protoXamlNode; yield return nodeBuilder.EndTag(); }
private IEnumerable<ProtoXamlNode> ParseEmptyElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes) { var emptyElement = nodeBuilder.EmptyElement(xamlType.UnderlyingType, namespaceDeclaration); return CommonNodesOfElement(xamlType, emptyElement, attributes); }
private IEnumerable<ProtoXamlNode> ParseExpandedElement(XamlType xamlType, string prefix, AttributeFeed attributes) { var element = nodeBuilder.NonEmptyElement(xamlType.UnderlyingType, prefix); foreach (var node in CommonNodesOfElement(xamlType, element, attributes)) yield return node; reader.Read(); foreach (var protoXamlNode in ParseNestedElements(xamlType)) yield return protoXamlNode; yield return nodeBuilder.EndTag(); }
private IEnumerable<ProtoXamlNode> ParseEmptyElement(XamlType xamlType, string prefix, AttributeFeed attributes) { var emptyElement = nodeBuilder.EmptyElement(xamlType.UnderlyingType, prefix); return CommonNodesOfElement(xamlType, emptyElement, attributes); }