예제 #1
0
 internal XmlElementBuilder(XElement parent, IXmlElementBuilder parentElementBuilder, XName elementName)
 {
     _value  = null;
     _parent = parent;
     _parentElementBuilder = parentElementBuilder;
     _element = new XElement(elementName);
 }
예제 #2
0
        public XmlAttributeBuilder(IXmlElementBuilder xmlElementBuilder, XElement element, string attributeName)
        {
            Guard.StringNotNullOrEmpty(() => attributeName);
            Guard.ObjectNotNull(() => xmlElementBuilder);
            Guard.ObjectNotNull(() => element);

            _xmlElementBuilder = xmlElementBuilder;
            _element           = element;
            _attributeName     = attributeName;
        }
예제 #3
0
        public XmlBuilderStream(IXmlElementBuilder node, Encoding encoding)
        {
            Encoding    = encoding ?? throw new ArgumentNullException(nameof(encoding));
            _disposable = node as IDisposable;
            var enumerable = node == null
                                ? Enumerable.Empty <IXmlElementBuilder>()
                                : Enumerable.Repeat(node, 1);

            _enumerators = new();
            _enumerators.AddLast(enumerable.GetConservativeEnumerator());
        }
        public XmlBuilderReader(IXmlElementBuilder node)
        {
            // ReSharper disable once SuspiciousTypeConversion.Global
            _disposable = node as IDisposable;
            var enumerable = node == null
                                ? Enumerable.Empty <IXmlElementBuilder>()
                                : Enumerable.Repeat(node, 1);

            _enumerators = new LinkedList <ConservativeEnumerator>();
            _enumerators.AddLast(enumerable.GetConservativeEnumerator());
            _nodeType         = XmlNodeType.None;
            _table            = new NameTable();
            _namespaceManager = new XmlNamespaceManager(_table);
        }
        public XmlBuilderStream(IXmlElementBuilder node, Encoding encoding)
        {
            if (encoding == null)
            {
                throw new ArgumentNullException("encoding");
            }
            // ReSharper disable once SuspiciousTypeConversion.Global
            _disposable = node as IDisposable;
            _encoding   = encoding;
            var enumerable = node == null
                                ? Enumerable.Empty <IXmlElementBuilder>()
                                : Enumerable.Repeat(node, 1);

            _enumerators = new LinkedList <ConservativeEnumerator>();
            _enumerators.AddLast(enumerable.GetConservativeEnumerator());
        }
예제 #6
0
 public XmlBuilderStream(IXmlElementBuilder node) : this(node, Encoding.UTF8)
 {
 }