public void HandleError(LogError error) { if (InvokeRequired) { BeginInvoke(new Action(() => HandleError(error))); return; } errorPanel.Title = error.Title; errorPanel.Text = $"{error.Message}{(error.Message.EndsWith(".") ? string.Empty : ".")}"; errorPanelBack.BackColor = error.BackColor; errorPanel.BackColor = error.BackColor; errorPanel.ForeColor = error.ForeColor; lnkClose.ForeColor = ControlPaint.Dark(error.BackColor); lnkClose.ActiveLinkColor = ControlPaint.Dark(error.BackColor); lnkClose.VisitedLinkColor = ControlPaint.Dark(error.BackColor); errorPanel.Visible = true; lnkClose.Visible = true; errorPanelBack.Visible = true; }