Aetheria/Assets/Scripts/NIH/MSAGL/Layout/Layered/SugiyamaLayoutLogger.cs
hyperion51 01a956eef6 MSAGL Support
Added new tech tree layout implementation using Microsoft Automatic Graph Layouts
Added some functionality to the database editor tools
2020-04-14 00:42:04 +01:00

43 lines
No EOL
1 KiB
C#

using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
namespace Microsoft.Msagl.Layout.Layered {
#if REPORTING
/// <summary>
/// Log class
/// </summary>
public sealed class SugiyamaLayoutLogger : IDisposable {
static StreamWriter sw;
internal SugiyamaLayoutLogger() {}
#region IDisposable Members
/// <summary>
/// disposes the object
/// </summary>
public void Dispose() {
sw.Close();
sw.Dispose();
sw = null;
GC.SuppressFinalize(this);
}
#endregion
/// <summary>
/// writes a message to the log file
/// </summary>
/// <param name="message"></param>
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
public void Write(string message) {
if (sw == null) sw = new StreamWriter("msaglLogFile");
sw.Write(message);
sw.Flush();
Console.WriteLine(message);
}
}
#endif
}