mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-09-14 11:58:02 -05:00
retry clipboard on failure
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user