using System;
using System.IO;
using System.Windows;

namespace SurfacePlot3D.Extensions
{
    public static partial class UniqueExtensions
    {
        public static void WriteFile(this String text, String fullPath, Boolean append)
        {
            try
            {
                String path = fullPath.Replace("\\\\", "\\");
                StreamWriter streamWriter = new StreamWriter(path);
                streamWriter.AutoFlush = true;
                streamWriter.WriteLine(FormatXml(text));
                streamWriter.Close();
                streamWriter.Dispose();
                streamWriter = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}