|
@@ -32,32 +32,30 @@ namespace Terminal.Gui {
|
|
/// </summary>
|
|
/// </summary>
|
|
public static ustring Contents {
|
|
public static ustring Contents {
|
|
get {
|
|
get {
|
|
- return contents = ustring.Make (Application.Driver.Clipboard.GetClipboardData ());
|
|
|
|
- //try {
|
|
|
|
- // if (IsSupported) {
|
|
|
|
- // return contents = ustring.Make (Application.Driver.Clipboard.GetClipboardData ());
|
|
|
|
- // } else {
|
|
|
|
- // return ustring.Make ("Clipboard not supported"); // contents;
|
|
|
|
- // }
|
|
|
|
- //} catch (Exception) {
|
|
|
|
- // return contents;
|
|
|
|
- //}
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (IsSupported) {
|
|
|
|
+ return contents = ustring.Make (Application.Driver.Clipboard.GetClipboardData ());
|
|
|
|
+ } else {
|
|
|
|
+ return ustring.Make ("Clipboard not supported"); // contents;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception) {
|
|
|
|
+ return contents;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
set {
|
|
set {
|
|
- Application.Driver.Clipboard.SetClipboardData (value.ToString ());
|
|
|
|
- //try {
|
|
|
|
- // if (IsSupported) {
|
|
|
|
- // if (value == null) {
|
|
|
|
- // value = string.Empty;
|
|
|
|
- // }
|
|
|
|
- // Application.Driver.Clipboard.SetClipboardData (value.ToString ());
|
|
|
|
- // }
|
|
|
|
- // contents = value;
|
|
|
|
- //} catch (NotSupportedException e) {
|
|
|
|
- // throw e;
|
|
|
|
- //} catch (Exception) {
|
|
|
|
- // contents = value;
|
|
|
|
- //}
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (IsSupported) {
|
|
|
|
+ if (value == null) {
|
|
|
|
+ value = string.Empty;
|
|
|
|
+ }
|
|
|
|
+ Application.Driver.Clipboard.SetClipboardData (value.ToString ());
|
|
|
|
+ }
|
|
|
|
+ contents = value;
|
|
|
|
+ } catch (NotSupportedException e) {
|
|
|
|
+ throw e;
|
|
|
|
+ } catch (Exception) {
|
|
|
|
+ contents = value;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|