public static void ShowReport(string title, string report, IWin32Window parent) { using (var dlg = new LogWindow()) { var ss = report.Split('\n'); foreach (var s in ss) dlg.Lines.Add(s.TrimEnd('\r')); dlg.virtualListView1.ItemCount = ss.Length; dlg.Text = title; dlg.btnClear.Visible = false; dlg.ShowDialog(parent); } }
public static void HideConsole() { if (ConsoleVisible == false) return; Console.SetOut(TextWriter.Null); ConsoleVisible = false; if (NeedToRelease) { ReleaseConsole(); NeedToRelease = false; } else { logStream.Close(); logStream = null; Log.HACK_LOG_STREAM = null; window.Close(); window = null; } }
public static void ShowConsole() { if (ConsoleVisible) return; ConsoleVisible = true; if (Global.Config.WIN32_CONSOLE) { NeedToRelease = true; CreateConsole(); //not sure whether we need to set a buffer size here //var sout = new StreamWriter(Console.OpenStandardOutput(),Encoding.ASCII,1) { AutoFlush = true }; //var sout = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }; //Console.SetOut(sout); //Console.Title = "BizHawk Message Log"; //System.Runtime.InteropServices.SafeFi //new Microsoft.Win32.SafeHandles.SafeFileHandle( } else { logStream = new LogStream(); Log.HACK_LOG_STREAM = logStream; var sout = new StreamWriter(logStream) { AutoFlush = true }; new StringBuilder(); //not using this right now Console.SetOut(sout); window = new LogWindow(); window.Show(); logStream.Emit = (str) => { window.Append(str); }; } }