public static void ClearClipboard() { try { Clipboard.Clear(); } catch (Exception ex) when(ExceptionFilters.ClipboardExceptions(ex)) { DisplayMessage.ErrorMessageBox(ex.GetType().Name, "Unable to clear the clipboard."); } }
public static void SetClipboard(string text) { try { if (!string.IsNullOrEmpty(text)) { Clipboard.SetText(text); } } catch (Exception ex) when(ExceptionFilters.ClipboardExceptions(ex)) { DisplayMessage.ErrorMessageBox(ex.GetType().Name, "Unable to copy text to the clipboard."); } }