示例#1
0
 public Stream GetStream(IApplicationReader reader)
 {
     if (!String.IsNullOrEmpty(ReportPath))
     {
         return(reader.FileStreamFullPathRO(ReportPath));
     }
     else if (ReportStream != null)
     {
         return(new MemoryStream(ReportStream));
     }
     throw new InvalidOperationException("Invalid report stream mode");
 }
示例#2
0
        Stream GetFileStream(String fileName)
        {
            if (fileName.EndsWith(".d"))
            {
                fileName += ".ts";
            }
            else if (!fileName.EndsWith(".d.ts"))
            {
                fileName += ".d.ts";
            }
            var fullPath = _reader.MakeFullPath(_path, fileName);

            return(_reader.FileStreamFullPathRO(fullPath));
        }
示例#3
0
 IEnumerable <String> ReadLines(IApplicationReader reader, String path)
 {
     using (var stream = reader.FileStreamFullPathRO(path))
     {
         using (var rdr = new StreamReader(stream))
         {
             while (!rdr.EndOfStream)
             {
                 var s = rdr.ReadLine();
                 if (String.IsNullOrEmpty(s) || s.StartsWith(";"))
                 {
                     continue;
                 }
                 yield return(s);
             }
         }
     }
 }