예제 #1
0
파일: FileIndex.cs 프로젝트: andiges/nBayes
 /// <exception cref="InvalidOperationException">Occurs when the serializer has trouble
 /// deserializing the file on disk. Can occur if the file is corrupted.</exception>
 public void Open()
 {
     if (File.Exists(this.filePath))
     {
         string      json        = File.ReadAllText(filePath);
         MemoryIndex memoryIndex = JsonConvert.DeserializeObject <MemoryIndex>(json);
         index.table     = memoryIndex.table;
         index.TextCount = memoryIndex.TextCount;
     }
 }