private IEnumerable<ProtoXamlInstruction> CommonNodesOfElement(XamlType owner, ProtoXamlInstruction elementToInject, AttributeFeed attributeFeed)
        {
            var attributes = attributeFeed;

            foreach (var instruction in attributes.PrefixRegistrations.Select(ConvertAttributeToNsPrefixDefinition)) yield return instruction;

            yield return elementToInject;

            foreach (var instruction in attributes.Directives.Select(ConvertDirective)) yield return instruction;
            foreach (var instruction in attributes.RawAttributes.Select(a => ConvertAttributeToNode(owner, a))) yield return instruction;
        }
        private IEnumerable<ProtoInstruction> ParseExpandedElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes)
        {
            var element = instructionBuilder.NonEmptyElement(xamlType.UnderlyingType, namespaceDeclaration);
            foreach (var instruction in CommonNodesOfElement(xamlType, element, attributes)) yield return instruction;

            reader.Read();

            foreach (var instruction in ParseInnerTextIfAny()) yield return instruction;
            foreach (var instruction in ParseNestedElements(xamlType)) yield return instruction;

            yield return instructionBuilder.EndTag();
        }
        private IEnumerable <ProtoXamlInstruction> ParseExpandedElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes)
        {
            var element = instructionBuilder.NonEmptyElement(xamlType.UnderlyingType, namespaceDeclaration);

            foreach (var instruction in CommonNodesOfElement(xamlType, element, attributes))
            {
                yield return(instruction);
            }

            reader.Read();

            foreach (var instruction in ParseInnerTextIfAny())
            {
                yield return(instruction);
            }
            foreach (var instruction in ParseNestedElements(xamlType))
            {
                yield return(instruction);
            }

            yield return(instructionBuilder.EndTag());
        }
        private IEnumerable <ProtoXamlInstruction> CommonNodesOfElement(XamlType owner, ProtoXamlInstruction elementToInject, AttributeFeed attributeFeed)
        {
            var attributes = attributeFeed;

            foreach (var instruction in attributes.PrefixRegistrations.Select(ConvertAttributeToNsPrefixDefinition))
            {
                yield return(instruction);
            }

            yield return(elementToInject);

            foreach (var instruction in attributes.Directives.Select(ConvertDirective))
            {
                yield return(instruction);
            }
            foreach (var instruction in attributes.RawAttributes.Select(a => ConvertAttributeToNode(owner, a)))
            {
                yield return(instruction);
            }
        }
        private IEnumerable <ProtoXamlInstruction> ParseEmptyElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes)
        {
            var emptyElement = instructionBuilder.EmptyElement(xamlType.UnderlyingType, namespaceDeclaration);

            return(CommonNodesOfElement(xamlType, emptyElement, attributes));
        }
 private IEnumerable<ProtoXamlInstruction> ParseEmptyElement(XamlType xamlType, NamespaceDeclaration namespaceDeclaration, AttributeFeed attributes)
 {
     var emptyElement = instructionBuilder.EmptyElement(xamlType.UnderlyingType, namespaceDeclaration);
     return CommonNodesOfElement(xamlType, emptyElement, attributes);
 }