Inheritance: IDisposable
示例#1
0
 public static Specification ReadFromText(string text)
 {
     using (var reader = new MarkdownReader(new StringReader(text)))
     {
         return reader.Read();
     }
 }
示例#2
0
 public static Specification ReadFromText(string text)
 {
     using (var reader = new MarkdownReader(new StringReader(text)))
     {
         return(reader.Read());
     }
 }
示例#3
0
        public static Specification ReadFromFile(string file)
        {
            using (var stream = new FileStream(file, FileMode.Open))
            {
                var reader = new StreamReader(stream);

                var spec = new MarkdownReader(reader).Read();
                spec.Filename = file;

                return(spec);
            }
        }
示例#4
0
        public static Specification ReadFromFile(string file)
        {
            using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read))
            {
                using (var reader = new StreamReader(stream))
                {
                    var spec = new MarkdownReader(reader).Read();
                    spec.Filename = file;

                    return spec;
                }
            }
        }
        public static Specification ReadFromFile(string file)
        {
            using (var stream = new FileStream(file, FileMode.Open, FileAccess.Read))
            {
                using (var reader = new StreamReader(stream))
                {
                    var spec = new MarkdownReader(reader).Read();
                    spec.Filename = file;

                    if (spec.name.IsEmpty())
                    {
                        spec.name = Path.GetFileNameWithoutExtension(file);
                        ConsoleWriter.Write(ConsoleColor.Yellow, $"The spec file at {file} appears to be empty");
                    }

                    return(spec);
                }
            }
        }