Bloom.Shell.DisplayProblemToUser C# (CSharp) Method

DisplayProblemToUser() public static method

Display a dialog box that reports a problem to the user.
On Linux at least, displaying a dialog on a thread that is not the main GUI thread causes a crash with a segmentation violation. So we try to display on the main thread.
public static DisplayProblemToUser ( string message ) : void
message string
return void
        public static void DisplayProblemToUser(string message, params object[] args)
        {
            var forms = Application.OpenForms;
            for (int i = 0; i < forms.Count; ++i)
            {
                var s = forms [i] as Bloom.Shell;
                if (s != null && s.InvokeRequired)
                {
                    var d = new Shell.NotifyTheUserOfProblem(SIL.Reporting.ErrorReport.NotifyUserOfProblem);
                    s.Invoke(d, new object[] { message, args });
                    return;
                }
            }
            SIL.Reporting.ErrorReport.NotifyUserOfProblem(message, args);
        }