Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 private IEnumerable<ProtoXamlNode> ParseEmptyElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes)
 {
     var emptyElement = nodeBuilder.EmptyElement(xamlType.UnderlyingType, namespaceDeclaration);
     return CommonNodesOfElement(xamlType, emptyElement, attributes);
 }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 private IEnumerable<ProtoXamlNode> ParseEmptyElement(XamlType xamlType, string prefix, AttributeFeed attributes)
 {
     var emptyElement = nodeBuilder.EmptyElement(xamlType.UnderlyingType, prefix);
     return CommonNodesOfElement(xamlType, emptyElement, attributes);
 }