Beispiel #1
0
 public static PropertyTree FromStreamContext(StreamContext streamContext, Encoding encoding = null)
 {
     if (streamContext == null)
     {
         throw new ArgumentNullException("streamContext"); // $NON-NLS-1
     }
     using (PropertyTreeReader reader = PropertyTreeReader.CreateXml(streamContext, encoding, null)) {
         return(reader.ReadPropertyTree());
     }
 }
Beispiel #2
0
 public static PropertyTree FromStream(Stream stream,
                                       Encoding encoding = null)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream"); // $NON-NLS-1
     }
     using (var reader = PropertyTreeReader.CreateXml(stream, encoding, null)) {
         if (reader.Read())
         {
             return(reader.ReadPropertyTree());
         }
         else
         {
             throw Failure.Eof();
         }
     }
 }
 public static PropertyTreeXmlReader Create(XmlReader inputReader, PropertyTreeXmlReaderSettings settings = null)
 {
     return(PropertyTreeReader.CreateXml(inputReader, settings));
 }
 public static PropertyTreeXmlReader Create(Stream inputStream, Encoding encoding = null, PropertyTreeXmlReaderSettings settings = null)
 {
     return(PropertyTreeReader.CreateXml(inputStream, encoding, settings));
 }
 public static PropertyTreeXmlReader Create(string inputFileName, Encoding encoding = null, PropertyTreeXmlReaderSettings settings = null)
 {
     return(PropertyTreeReader.CreateXml(inputFileName, encoding, settings));
 }
 static Func <StreamContext, Encoding, PropertyTreeReaderSettings, PropertyTreeReader> GetFactoryFunc(string lp)
 {
     return((s, e, settings) => (PropertyTreeReader.CreateXml(s, e, new PropertyTreeXmlReaderSettings(settings))));
 }