public static void Save(GeneralSettings generalSettings, IEnumerable<Action> actions, string fileName) { var result = new StringBuilder(); result.AppendLine(string.Format("{0} {1}", SectionSeparatorString, Strings.GeneralSettings)); result.AppendLine(generalSettings.SaveToString()); foreach (var action in actions) { result.AppendLine(String.Format("{0} {1}", SectionSeparatorString, Strings.Action)); result.AppendLine(action.SaveToString(action.GetActionName())); result.AppendLine(); } using (var stream = new StreamWriter(fileName, false)) { stream.Write(result); } }