retry clipboard on failure

This commit is contained in:
Haven1433
2022-08-19 21:53:38 -05:00
parent f2301e5562
commit 216887b7d7

View File

@@ -45,9 +45,14 @@ namespace HavenSoft.HexManiac.WPF.Implementations {
try {
Clipboard.SetDataObject(value, true);
} catch (COMException) {
// something went wrong... we couldn't copy
var window = (MainWindow)Application.Current.MainWindow;
window.ViewModel.ErrorMessage = "Could not copy";
try {
// try again, but don't try to persist the value after app exit
Clipboard.SetDataObject(value);
} catch (COMException) {
// something went wrong... we couldn't copy
var window = (MainWindow)Application.Current.MainWindow;
window.ViewModel.ErrorMessage = "Could not copy";
}
}
}
}