public void SaveFlow(Flow steps) { if (File.Exists(FileName)) { string bak = FileName + ".bak"; if (File.Exists(bak)) File.Delete(bak); File.Move(FileName, bak); } string xml = steps.ToXml(); using (var wt = new StreamWriter(FileName, false, Encoding.UTF8)) { wt.Write(xml); wt.Flush(); } }