Net.Sf.Dbdeploy.Scripts.ChangeScript.GetFileContents C# (CSharp) Method

GetFileContents() private method

Gets the file contents.
private GetFileContents ( bool undo = false ) : string
undo bool if set to true the undo content will be gathered; otherwise standard update content will be gathered.
return string
        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();
        }
    }