using System; using System.Diagnostics.CodeAnalysis; using System.IO; namespace Microsoft.Msagl.Layout.Layered { #if REPORTING /// /// Log class /// public sealed class SugiyamaLayoutLogger : IDisposable { static StreamWriter sw; internal SugiyamaLayoutLogger() {} #region IDisposable Members /// /// disposes the object /// public void Dispose() { sw.Close(); sw.Dispose(); sw = null; GC.SuppressFinalize(this); } #endregion /// /// writes a message to the log file /// /// [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 }