Exemplo n.º 1
0
 public static DomReader Create(string fileName, DomReaderSettings settings)
 {
     if (fileName == null)
     {
         throw new ArgumentNullException(nameof(fileName));
     }
     return(Create(StreamContext.FromFile(fileName), settings));
 }
Exemplo n.º 2
0
        public DomReader CreateReader(TextReader reader, DomReaderSettings settings)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            return(CreateDomReader(reader, settings));
        }
Exemplo n.º 3
0
        public static DomReader Create(StreamContext input, DomReaderSettings settings)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }
            var provider = DomProviderFactory.ForFileName(settings, Utility.LocalPath(input.Uri));

            return(provider.CreateReader(input.OpenText(), settings));
        }
Exemplo n.º 4
0
        public static DomReader Create(TextReader reader, DomReaderSettings settings)
        {
            if (settings == null)
            {
                return(Create(XmlReader.Create(reader)));
            }

            var pro = DomProviderFactory.ForProviderObject(settings) ?? DomProviderFactory.Default;

            return(pro.CreateReader(reader, settings));
        }
Exemplo n.º 5
0
        public static DomReaderSettings ReadOnly(DomReaderSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (settings.IsReadOnly)
            {
                return(settings);
            }
            var s = settings.CloneReadOnly();

            s.IsReadOnly = true;
            return(s);
        }
Exemplo n.º 6
0
 protected DomReader(DomReaderSettings settings)
 {
     _settings = settings ?? DomReaderSettings.Empty;
     _errors   = new DomErrorCollection(_settings.MaxErrors);
 }
Exemplo n.º 7
0
 protected virtual DomReader CreateDomReader(TextReader reader, DomReaderSettings settings)
 {
     return(DomReader.Create(XmlReader.Create(reader)));
 }
Exemplo n.º 8
0
 protected DomReader(DomReaderSettings settings)
 {
     this.settings = settings ?? DomReaderSettings.Empty;
 }
Exemplo n.º 9
0
 static DomReaderSettings()
 {
     Empty = new DomReaderSettings();
     Empty.MakeReadOnly();
 }
Exemplo n.º 10
0
 public DomReader CreateReader(string path, DomReaderSettings settings)
 {
     return CreateDomReader(File.OpenText(path), settings);
 }
Exemplo n.º 11
0
 protected virtual DomReader CreateDomReader(TextReader reader, DomReaderSettings settings)
 {
     return DomReader.CreateXml(reader);
 }
Exemplo n.º 12
0
        public DomReader CreateReader(TextReader reader, DomReaderSettings settings)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");

            return CreateDomReader(reader, settings);
        }
Exemplo n.º 13
0
 public XmlDomReader(XmlReader xml,
                     DomReaderSettings settings) : base(settings)
 {
     this.xml = xml;
 }
Exemplo n.º 14
0
 public XmlDomReader(XmlReader xml,
                     DomReaderSettings settings)
     : base(settings)
 {
     this.xml = xml;
 }
Exemplo n.º 15
0
 static DomReaderSettings()
 {
     Empty = ReadOnly(new DomReaderSettings());
 }
Exemplo n.º 16
0
 public DomReader CreateReader(string path, DomReaderSettings settings)
 {
     return(CreateDomReader(File.OpenText(path), settings));
 }
Exemplo n.º 17
0
        public static DomReader Create(TextReader reader, DomReaderSettings settings)
        {
            if (settings == null)
                return CreateXml(reader);

            var pro = DomProviderFactory.ForProviderObject(settings);

            if (pro == null)
                return CreateXml(reader);

            return pro.CreateReader(reader, settings);
        }