public void Save(object surface, string file) { ISurface textSurface = (ISurface)surface; SurfaceEditor editor = new SurfaceEditor(textSurface); string[] lines = new string[textSurface.Height]; for (int y = 0; y < textSurface.Height; y++) { lines[y] = editor.GetString(0, y, textSurface.Width); } System.IO.File.WriteAllLines(file, lines); }