/// <summary>Add text to the log</summary> public void AddMessage(string text) { if (!IsHandleCreated) { return; } if (InvokeRequired) { BeginInvoke((Action <string>)AddMessage, text); } else { // Use the FPos value of the last entry so that if 'AddMessage' is mixed with // entries read from a log file, the read position in the log file is preserved. var fpos = !LogEntries.Empty() ? LogEntries.Back().FPos : 0; LogEntries.Add(new LogEntry(fpos, text, false)); } }