浏览代码

moved UI Catalog unit tests back

Charlie Kindel 2 年之前
父节点
当前提交
6b9c179f75
共有 1 个文件被更改,包括 22 次插入24 次删除
  1. 22 24
      Terminal.Gui/Core/Clipboard/Clipboard.cs

+ 22 - 24
Terminal.Gui/Core/Clipboard/Clipboard.cs

@@ -32,32 +32,30 @@ namespace Terminal.Gui {
 		/// </summary>
 		public static ustring Contents {
 			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 {
-				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;
+				}
 			}
 		}