private string GetFileContents(bool undo = false)
{
var result = new StringBuilder();
bool foundUndo = false;
using (var input = new StreamReader(this.FileInfo.FullName, this.encoding))
{
string str;
while ((str = input.ReadLine()) != null)
{
// Just keep looping until we find the magic "--//@UNDO"
if (UndoToken == str.Trim())
{
foundUndo = true;
continue;
}
if (foundUndo == undo)
{
result.AppendLine(str);
}
}
}
return result.ToString();
}
}