private static void ThreadSafeStatusMessage(SMStatus _status, string _message, string _option) { if (MainForm != null && MainForm.InvokeRequired) // we are in a different thread to the main window { MainForm.Invoke(new AddStatusMessageDelegate(ThreadSafeStatusMessage), new object[] { _status, _message, _option }); // call self from main thread } else { OnNewStatusMessage(_status, _message, _option); } }