void OnMarkClicked(object sender, RoutedEventArgs e) { var entry = new ViewableLogEntry() { DateTime = DateTime.Now, Component = "M", Thread = "", Message = "", }; Add(entry); }
public void AddRange(IEnumerable <LogEntry> entries) { ViewableLogEntry last = null; if (m_debugCollection.Count > 0) { last = m_debugCollection.Last(); } foreach (var e in entries) { var ve = new ViewableLogEntry(e); if (last != null) { var td = ve.DateTime - last.DateTime; ve.TimeDiff = td; } m_debugCollection.Add(ve); last = ve; var str = String.Format("{0} | {1}: {2}", e.DateTime, e.Component, e.Message); if (m_logFile != null) { m_logFile.WriteLine(str); } if (m_netWriter != null) { m_netWriter.WriteLine(str); } } if (m_logFile != null) { m_logFile.Flush(); } while (m_debugCollection.Count > 500) { m_debugCollection.RemoveAt(0); } if (m_scrollToEnd && last != null) { logListView.ScrollIntoView(last); } }
public void Add(ViewableLogEntry entry) { if (m_debugCollection.Count > 0) { var last = m_debugCollection.Last(); var td = entry.DateTime - last.DateTime; entry.TimeDiff = td; } m_debugCollection.Add(entry); var str = String.Format("{0} | {1}: {2}", entry.DateTime, entry.Component, entry.Message); if (m_logFile != null) { m_logFile.WriteLine(str); } if (m_netWriter != null) { m_netWriter.WriteLine(str); } if (m_logFile != null) { m_logFile.Flush(); } while (m_debugCollection.Count > 500) { m_debugCollection.RemoveAt(0); } if (m_scrollToEnd) { logListView.ScrollIntoView(entry); } }
public void Add(LogEntry entry) { var ve = new ViewableLogEntry(entry); Add(ve); }
public void AddRange(IEnumerable<LogEntry> entries) { ViewableLogEntry last = null; if (m_debugCollection.Count > 0) last = m_debugCollection.Last(); foreach (var e in entries) { var ve = new ViewableLogEntry(e); if (last != null) { var td = ve.DateTime - last.DateTime; ve.TimeDiff = td; } m_debugCollection.Add(ve); last = ve; var str = String.Format("{0} | {1}: {2}", e.DateTime, e.Component, e.Message); if (m_logFile != null) m_logFile.WriteLine(str); if (m_netWriter != null) m_netWriter.WriteLine(str); } if (m_logFile != null) m_logFile.Flush(); while (m_debugCollection.Count > 500) m_debugCollection.RemoveAt(0); if (m_scrollToEnd && last != null) logListView.ScrollIntoView(last); }
public void Add(LogEntry entry) { var ve = new ViewableLogEntry(entry); if (m_debugCollection.Count > 0) { var last = m_debugCollection.Last(); var td = ve.DateTime - last.DateTime; ve.TimeDiff = td; } m_debugCollection.Add(ve); var str = String.Format("{0} | {1}: {2}", entry.DateTime, entry.Component, entry.Message); if (m_logFile != null) m_logFile.WriteLine(str); if (m_netWriter != null) m_netWriter.WriteLine(str); if (m_logFile != null) m_logFile.Flush(); while (m_debugCollection.Count > 500) m_debugCollection.RemoveAt(0); if (m_scrollToEnd) logListView.ScrollIntoView(ve); }