コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }