-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExporterExtensions.cs
33 lines (31 loc) · 1.15 KB
/
ExporterExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ExporterExtensions.cs" company="OxyPlot">
// Copyright (c) 2014 OxyPlot contributors
// </copyright>
// <summary>
// Provides extension methods for exporters.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace OxyPlot.EtoForms
{
using System.IO;
/// <summary>
/// Provides extension methods for exporters.
/// </summary>
public static class ExporterExtensions
{
/// <summary>
/// Exports the specified <see cref="PlotModel" /> to a file.
/// </summary>
/// <param name="exporter">The exporter.</param>
/// <param name="model">The model to export.</param>
/// <param name="path">The path to the file.</param>
public static void ExportToFile(this IExporter exporter, IPlotModel model, string path)
{
using (var stream = File.OpenWrite(path))
{
exporter.Export(model, stream);
}
}
}
}