Esempio n. 1
0
 public override void Save <T>(AbstractPlugin plugin, T obj)
 {
     using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write))
     {
         string text   = JsonConvert.SerializeObject(obj);
         byte[] buffer = Encoding.ASCII.GetBytes(text);
         if (plugin != null)
         {
             buffer = plugin.Encrypt(buffer);
         }
         fs.Write(buffer, 0, buffer.Length);
         fs.Flush();
     }
 }