public static void SaveCallToFile(Call call, string fileName) { CreateDirectoryIfNeeded(fileName); using (var textWriter = new StreamWriter(new FileStream(fileName, FileMode.OpenOrCreate))) { CallSerializer.SerializeCall(call, textWriter); } }
public void SaveCall(Call call) { var fileName = GetFileName(call.Input); SaveCallToFile(call, fileName); _calls.Add(call); }