2using System.ComponentModel;
4using System.Threading.Tasks;
11 [EditorBrowsable(EditorBrowsableState.Never)]
26 public static void Save(
this Workbook workbook)
28 XlsxWriter l =
new XlsxWriter(workbook);
48 public static async Task
SaveAsync(
this Workbook workbook)
50 XlsxWriter l =
new XlsxWriter(workbook);
68 public static void SaveAs(
this Workbook workbook,
string filename)
70 string backup = filename;
71 workbook.Filename = filename;
72 XlsxWriter l =
new XlsxWriter(workbook);
74 workbook.Filename = backup;
95 public static async Task
SaveAsAsync(
this Workbook workbook,
string fileName)
97 string backup = fileName;
98 workbook.Filename = fileName;
99 XlsxWriter l =
new XlsxWriter(workbook);
101 workbook.Filename = backup;
133 public static void SaveAsStream(
this Workbook workbook, Stream stream,
bool leaveOpen =
false)
135 using (MemoryStream ms =
new MemoryStream())
139 XlsxWriter l =
new XlsxWriter(workbook);
140 l.SaveAsStream(stream, leaveOpen);
179 public static async Task
SaveAsStreamAsync(
this Workbook workbook, Stream stream,
bool leaveOpen =
false)
181 XlsxWriter l =
new XlsxWriter(workbook);
182 await l.SaveAsStreamAsync(stream, leaveOpen);
Writer extension methods for the Workbook class.
static async Task SaveAsync(this Workbook workbook)
Saves the workbook asynchronous.
static async Task SaveAsAsync(this Workbook workbook, string fileName)
Saves the workbook with the defined name asynchronous.
static void SaveAsStream(this Workbook workbook, Stream stream, bool leaveOpen=false)
Save the workbook to a writable stream.
static async Task SaveAsStreamAsync(this Workbook workbook, Stream stream, bool leaveOpen=false)
Save the workbook to a writable stream asynchronous.
static void Save(this Workbook workbook)
Saves the workbook.
static void SaveAs(this Workbook workbook, string filename)
Saves the workbook with the defined name.