1' 2' ClipboardProxy.vb 3' 4' Authors: 5' Rolf Bjarne Kvinge (RKvinge@novell.com) 6' 7' Copyright (C) 2007 Novell (http://www.novell.com) 8' 9' Permission is hereby granted, free of charge, to any person obtaining 10' a copy of this software and associated documentation files (the 11' "Software"), to deal in the Software without restriction, including 12' without limitation the rights to use, copy, modify, merge, publish, 13' distribute, sublicense, and/or sell copies of the Software, and to 14' permit persons to whom the Software is furnished to do so, subject to 15' the following conditions: 16' 17' The above copyright notice and this permission notice shall be 18' included in all copies or substantial portions of the Software. 19' 20' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21' EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22' MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23' NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24' LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25' OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26' WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27' 28 29#If TARGET_JVM = False Then 30Imports System.ComponentModel 31Imports System.Collections.Specialized 32Imports System.IO 33Imports System.Drawing 34Imports System.Windows.Forms 35 36Namespace Microsoft.VisualBasic.MyServices 37 38 <EditorBrowsable(EditorBrowsableState.Never)> _ 39 Public Class ClipboardProxy 40 Friend Sub New() 41 'Empty constructor 42 End Sub 43 44 Public Sub Clear() 45 Clipboard.Clear() 46 End Sub 47 48 Public Function ContainsAudio() As Boolean 49 Return Clipboard.ContainsAudio 50 End Function 51 52 Public Function ContainsData(ByVal format As String) As Boolean 53 Return Clipboard.ContainsData(format) 54 End Function 55 56 Public Function ContainsFileDropList() As Boolean 57 Return Clipboard.ContainsFileDropList() 58 End Function 59 60 Public Function ContainsImage() As Boolean 61 Return Clipboard.ContainsImage 62 End Function 63 64 Public Function ContainsText() As Boolean 65 Return Clipboard.ContainsText 66 End Function 67 68 Public Function ContainsText(ByVal format As TextDataFormat) As Boolean 69 Return Clipboard.ContainsText(format) 70 End Function 71 72 Public Function GetAudioStream() As Stream 73 Return Clipboard.GetAudioStream 74 End Function 75 76 Public Function GetData(ByVal format As String) As Object 77 Return Clipboard.GetData(format) 78 End Function 79 80 <EditorBrowsable(EditorBrowsableState.Advanced)> _ 81 Public Function GetDataObject() As IDataObject 82 Return Clipboard.GetDataObject() 83 End Function 84 85 Public Function GetFileDropList() As StringCollection 86 Return Clipboard.GetFileDropList 87 End Function 88 89 Public Function GetImage() As Image 90 Return Clipboard.GetImage 91 End Function 92 93 Public Function GetText() As String 94 Return Clipboard.GetText 95 End Function 96 97 Public Function GetText(ByVal format As TextDataFormat) As String 98 Return Clipboard.GetText(format) 99 End Function 100 101 Public Sub SetAudio(ByVal audioStream As Stream) 102 Clipboard.SetAudio(audioStream) 103 End Sub 104 105 Public Sub SetAudio(ByVal audioBytes As Byte()) 106 Clipboard.SetAudio(audioBytes) 107 End Sub 108 109 Public Sub SetData(ByVal format As String, ByVal data As Object) 110 Clipboard.SetData(format, data) 111 End Sub 112 113 <EditorBrowsable(EditorBrowsableState.Advanced)> _ 114 Public Sub SetDataObject(ByVal data As DataObject) 115 Clipboard.SetDataObject(data) 116 End Sub 117 118 Public Sub SetFileDropList(ByVal filePaths As StringCollection) 119 Clipboard.SetFileDropList(filePaths) 120 End Sub 121 122 Public Sub SetImage(ByVal image As Image) 123 Clipboard.SetImage(image) 124 End Sub 125 126 Public Sub SetText(ByVal text As String) 127 Clipboard.SetText(text) 128 End Sub 129 130 Public Sub SetText(ByVal text As String, ByVal format As TextDataFormat) 131 Clipboard.SetText(text, format) 132 End Sub 133 End Class 134End Namespace 135#End If 136