private void AddMessage(string msg, MessageType msgType, MessageSource src) { if (InvokeRequired) { BeginInvoke(new AddMessageDelegate(AddMessage), new object[] { msg, msgType, src }); } else { string source = "Global"; if (src != null) source = src.Source; if (msgType != MessageType.Note) { ListViewItem lvi = new ListViewItem(new string[] { source, msg }, msgType.ToString()); lvi.Tag = src; Items.Add(lvi); while (Items.Count > maxEntries) Items.RemoveAt(0); EnsureVisible(lvi.Index); } if (logStreamWriter != null) { logStreamWriter.WriteLine(DateTime.Now.ToString() + ": " + source + "; " + msgType.ToString() + "; " + msg); logStreamWriter.Flush(); } } }
private void AddMessage(string msg, MessageType msgType, MessageSource src) { if (InvokeRequired) { BeginInvoke(new AddMessageDelegate(AddMessage), new object[] { msg, msgType, src }); } else { string source = "Global"; if (src != null) { source = src.Source; } if (msgType != MessageType.Note) { ListViewItem lvi = new ListViewItem(new string[] { source, msg }, msgType.ToString()); lvi.Tag = src; Items.Add(lvi); while (Items.Count > maxEntries) { Items.RemoveAt(0); } EnsureVisible(lvi.Index); } if (logStreamWriter != null) { logStreamWriter.WriteLine(DateTime.Now.ToString() + ": " + source + "; " + msgType.ToString() + "; " + msg); logStreamWriter.Flush(); } } }
public void Message(string msg, MessageType msgType) { MessageSource src = null; if (sourceStack.Count != 0) { src = sourceStack.Peek(); } AddMessage(msg, msgType, src); }
public void SetSource(MessageSource src) { logView.SetSource(src); }
public void Message(string msg, MessageType msgType, MessageSource src) { logView.Message(msg, msgType, src); }
public void SetSource(MessageSource src) { sourceStack.Push(src); }
public void Message(string msg, MessageType msgType, MessageSource src) { AddMessage(msg, msgType, src); }