internal static PTXReaderState AnyState(PropertyTreeXmlReader r, XmlReader reader)
            {
                while (reader.Read()) {
                    return ChooseState(reader);
                }

                return EOF;
            }
Ejemplo n.º 2
0
            internal static PTXReaderState AnyState(PropertyTreeXmlReader r, XmlReader reader)
            {
                while (reader.Read())
                {
                    return(ChooseState(reader));
                }

                return(EOF);
            }
Ejemplo n.º 3
0
            // On element, after attributes
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                if (reader.IsEmptyElement)
                {
                    r.PushState(PropertyNodeType.EndPropertyTree);
                    return(AnyState(r, reader));
                }

                return(AnyState(r, reader).Accept(r, reader));
            }
Ejemplo n.º 4
0
        public override void Load(TextReader reader, object instance)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            var ptx = PropertyTreeXmlReader.Create(reader);

            ptx.Bind(instance);
        }
Ejemplo n.º 5
0
        public override object Load(TextReader reader, Type instanceType)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            var ptx = PropertyTreeXmlReader.Create(reader);

            return(ptx.Bind(instanceType));
        }
Ejemplo n.º 6
0
            internal bool MoveToNextAttribute(PropertyTreeXmlReader r, XmlReader reader)
            {
                while (reader.MoveToNextAttribute())
                {
                    if (IsXmlnsDefinition(reader))
                    {
                        r.ExportNamespace();
                    }
                    else
                    {
                        return(true);
                    }
                }

                return(false);
            }
Ejemplo n.º 7
0
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                r.PushState(PropertyNodeType.PropertyTree);

                if (MoveToFirstAttribute(r, reader))
                {
                    return(Attribute);
                }

                else if (reader.IsEmptyElement)
                {
                    return(EndEmptyElement);
                }

                else
                {
                    return(EndStartElement);
                }
            }
Ejemplo n.º 8
0
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                r.PushState(PropertyNodeType.EndPropertyTree, PropertyNodeType.EndPropertyTree);

                if (r._elisionPosition > 0)
                {
                    r._elisionPosition--;
                    return(this);
                }

                if (MoveToNextAttribute(r, reader))
                {
                    return(PTXReaderState.Attribute);
                }
                else
                {
                    reader.MoveToElement();
                    return(PTXReaderState.EndStartElement);
                }
            }
Ejemplo n.º 9
0
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                if (r.PushState(PropertyNodeType.Property))
                {
                    r._elisionPosition++;
                    return(this);
                }
                if (r._elisionPosition > 0)
                {
                    // Don't repeat the property - but end all elided property trees
                    r._elisionPosition--;
                    return(PTXReaderState.EndAttributeElided);
                }

                if (MoveToNextAttribute(r, reader))
                {
                    return(this);
                }
                else
                {
                    reader.MoveToElement();
                    return(PTXReaderState.EndStartElement);
                }
            }
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                r.PushState(PropertyNodeType.Property);

                if (MoveToNextAttribute(r, reader)) {
                    return this;

                } else {
                    reader.MoveToElement();
                    return PTXReaderState.EndStartElement;
                }
            }
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     r.PushState(PropertyNodeType.EndPropertyTree);
     return AnyState(r, reader);
 }
Ejemplo n.º 12
0
 public abstract PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader);
Ejemplo n.º 13
0
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 14
0
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     return(AnyState(r, reader).Accept(r, reader));
 }
            // On element, after attributes
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                if (reader.IsEmptyElement) {
                    r.PushState(PropertyNodeType.EndPropertyTree);
                    return AnyState(r, reader);
                }

                return AnyState(r, reader).Accept(r, reader);
            }
Ejemplo n.º 16
0
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     r.PushState(PropertyNodeType.EndPropertyTree);
     return(AnyState(r, reader));
 }
            public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
            {
                r.PushState(PropertyNodeType.PropertyTree);

                if (MoveToFirstAttribute(r, reader))
                    return Attribute;

                else if (reader.IsEmptyElement)
                    return EndEmptyElement;

                else
                    return EndStartElement;
            }
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     throw new NotImplementedException();
 }
            internal bool MoveToFirstAttribute(PropertyTreeXmlReader r, XmlReader reader)
            {
                if (reader.MoveToFirstAttribute()) {
                    if (IsXmlnsDefinition(reader)) {
                        r.ExportNamespace();
                        return MoveToNextAttribute(r, reader);

                    } else {
                        return true;
                    }
                }

                return false;
            }
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     return AnyState(r, reader).Accept(r, reader);
 }
 public abstract PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader);