Inheritance: IDisposable
Beispiel #1
0
 /// <summary>
 /// Reads the specified reader.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns>System.Object.</returns>
 public abstract object Read(JsonReader reader);
Beispiel #2
0
 /// <summary>Loads the given stream.</summary>
 /// <exception cref="InvalidOperationException">Thrown when the requested file is not present.</exception>
 /// <param name="file">The file to load.</param>
 /// <returns>A Matrix.</returns>
 public static Matrix Load(string file)
 {
     if (File.Exists(file))
     {
         using (var fs = new FileStream(file, FileMode.Open))
         using (var f = new StreamReader(fs))
         using (var r = new JsonReader(f))
             return r.ReadMatrix();
     }
     else
         throw new InvalidOperationException("File not found");
 }
Beispiel #3
0
 /// <summary>
 /// Reads the closing content.
 /// </summary>
 /// <param name="reader"></param>
 public void PostRead(JsonReader reader)
 {
     reader.ReadEndObject();
 }