/// <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)); } }
/// <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()); } }