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

                return EOF;
            }
示例#2
0
            internal static PTXReaderState AnyState(PropertyTreeXmlReader r, XmlReader reader)
            {
                while (reader.Read())
                {
                    return(ChooseState(reader));
                }

                return(EOF);
            }
示例#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));
            }
示例#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);
        }
示例#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));
        }
示例#6
0
            internal bool MoveToNextAttribute(PropertyTreeXmlReader r, XmlReader reader)
            {
                while (reader.MoveToNextAttribute())
                {
                    if (IsXmlnsDefinition(reader))
                    {
                        r.ExportNamespace();
                    }
                    else
                    {
                        return(true);
                    }
                }

                return(false);
            }
示例#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);
                }
            }
示例#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);
                }
            }
示例#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);
 }
示例#12
0
 public abstract PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader);
示例#13
0
 public override PTXReaderState Accept(PropertyTreeXmlReader r, XmlReader reader)
 {
     throw new NotImplementedException();
 }
示例#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);
            }
示例#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);