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