Пример #1
0
 public static void ClearClipboard()
 {
     try
     {
         Clipboard.Clear();
     }
     catch (Exception ex) when(ExceptionFilters.ClipboardExceptions(ex))
     {
         DisplayMessage.ErrorMessageBox(ex.GetType().Name, "Unable to clear the clipboard.");
     }
 }
Пример #2
0
 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.");
     }
 }