Inheritance: IDisposable
Exemplo n.º 1
0
 /// <summary>
 /// Reads the specified reader.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <returns>System.Object.</returns>
 public abstract object Read(JsonReader reader);
Exemplo n.º 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");
 }
Exemplo n.º 3
0
 /// <summary>
 /// Reads the closing content.
 /// </summary>
 /// <param name="reader"></param>
 public void PostRead(JsonReader reader)
 {
     reader.ReadEndObject();
 }