Beispiel #1
0
 public PropertyTreeReaderSettings(PropertyTreeReaderSettings other)
 {
     if (other != null)
     {
         AllowExternals = other.AllowExternals;
     }
 }
 public static PropertyTreeReader Create(string fileName,
                                         Encoding encoding = null,
                                         PropertyTreeReaderSettings settings = null)
 {
     Require.NotNullOrEmptyString("fileName", fileName);
     return GetFactoryFunc(fileName)(StreamContext.FromFile(fileName), encoding, settings);
 }
        public static PropertyTreeReader Create(Stream stream,
                                                Encoding encoding = null,
                                                PropertyTreeReaderSettings settings = null)
        {
            if (stream == null)
                throw new ArgumentNullException("stream"); // $NON-NLS-1

            return CreateXml(stream, encoding, new PropertyTreeXmlReaderSettings(settings));
        }
 public static PropertyTreeReader Create(Stream stream,
                                         Encoding encoding = null,
                                         PropertyTreeReaderSettings settings = null)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream"); // $NON-NLS-1
     }
     return(CreateXml(stream, encoding, new PropertyTreeXmlReaderSettings(settings)));
 }
 public static PropertyTreeReader Create(string fileName,
                                         Encoding encoding = null,
                                         PropertyTreeReaderSettings settings = null)
 {
     if (fileName == null)
     {
         throw new ArgumentNullException("fileName");
     }
     if (string.IsNullOrEmpty(fileName))
     {
         throw Failure.EmptyString("fileName");
     }
     return(GetFactoryFunc(fileName)(StreamContext.FromFile(fileName), encoding, settings));
 }
        public static PropertyTreeReader Create(StreamContext streamContext,
                                                Encoding encoding = null,
                                                PropertyTreeReaderSettings settings = null)
        {
            if (streamContext == null)
                throw new ArgumentNullException("streamContext"); // $NON-NLS-1

            string lp = string.Empty;
            if (streamContext.Uri.IsAbsoluteUri) {
                lp = streamContext.Uri.LocalPath;
            }

            var result = GetFactoryFunc(lp)(streamContext,
                                            encoding,
                                            settings);
            return result;
        }
        public static PropertyTreeReader Create(StreamContext streamContext,
                                                Encoding encoding = null,
                                                PropertyTreeReaderSettings settings = null)
        {
            if (streamContext == null)
            {
                throw new ArgumentNullException("streamContext"); // $NON-NLS-1
            }
            string lp = string.Empty;

            if (streamContext.Uri.IsAbsoluteUri)
            {
                lp = streamContext.Uri.LocalPath;
            }

            var result = GetFactoryFunc(lp)(streamContext,
                                            encoding,
                                            settings);

            return(result);
        }
 public static PropertyTreeReader FromObject(object value,
                                             PropertyTreeReaderSettings settings = null)
 {
     return new PropertyTreeObjectReader(value);
 }
 public PropertyTreeXmlReaderSettings(PropertyTreeReaderSettings other) : base(other)
 {
 }
 public static PropertyTreeReader FromObject(object value,
                                             PropertyTreeReaderSettings settings = null)
 {
     return(new PropertyTreeObjectReader(value));
 }
 public PropertyTreeXmlReaderSettings(PropertyTreeReaderSettings other)
     : base(other)
 {
 }
Beispiel #12
0
 public static T ReadPropertyTree <T>(this StreamContext streamContext, Type type, Encoding encoding = null, PropertyTreeReaderSettings settings = null)
 {
     using (var reader = PropertyTreeReader.Create(streamContext, encoding, settings)) {
         reader.Read();
         return(reader.Bind <T>());
     }
 }
 public PropertyTreeReaderSettings(PropertyTreeReaderSettings other)
 {
     if (other != null) {
         this.AllowExternals = other.AllowExternals;
     }
 }