public void TrySaveFile()
{
if (ModuleDataManager.GetInstance().ModifiedFiles.Contains(this))
{
try
{
using (StreamWriter wr = new StreamWriter(Path, false, new UTF8Encoding(false)))
{
wr.Write(FlatFileData);
}
ModuleDataManager.GetInstance().ModifiedFiles.Remove(this);
}
catch (Exception e)
{
Console.WriteLine("Could not write to file " + Path + " because of exception: " + e.Message);
}
}
}