public SchemaFile Deserialize(SourceReader source) { using (source) { var file = new SchemaFile(); var reader = source.GetReader(); string line = null; while ((line = reader.ReadLine()) != null) { if (line.TrimStart().StartsWith("#")) { var text = line.Trim(); text = text.Substring(1); file.AddComment(text); } else if (line.Trim().Length == 0) { file.AddEmptyLine(); } else if (line.StartsWith(" ")) { var value = line.Trim(); if (value == "(null)") { value = null; } file.AddValue(value); } else { file.AddProperty(line.Trim()); } } return(file); } }
public Schema(SchemaFile file) { this.file = file; }
public static Schema Parse(SourceReader source) { var file = SchemaFile.Parse(source); return(new Schema(file)); }
public Schema() { this.file = new SchemaFile(); }