Example #1
0
 /// <summary>
 /// Sets the save type as being a Binary Encrypted file.
 /// </summary>
 public static void Encrypted(this HUMIO.Data.Persistant persistantData)
 {
     using (var fileStream = new FileStream(persistantData.path, FileMode.Create))
     {
         SerializationUtility.SerializeValue <object>(persistantData.save.value, SerializationUtility.CreateWriter(fileStream, new SerializationContext(), DataFormat.Binary));
     }
 }
Example #2
0
 /// <summary>
 /// Saves a text file to the persistant data path.
 /// </summary>
 public static void Text(this HUMIO.Data.Persistant persistantData)
 {
     using (var fileStream = new FileStream(persistantData.path, FileMode.Create))
     {
         StreamWriter writer = new StreamWriter(fileStream);
         writer.Write(persistantData.save.value.ToString());
     }
 }